| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/mp3/mp3_stream_parser.h" | 5 #include "media/mp3/mp3_stream_parser.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "media/base/bit_reader.h" | 10 #include "media/base/bit_reader.h" |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 | 371 |
| 372 if (config_.IsValidConfig() && | 372 if (config_.IsValidConfig() && |
| 373 (config_.samples_per_second() != sample_rate || | 373 (config_.samples_per_second() != sample_rate || |
| 374 config_.channel_layout() != channel_layout)) { | 374 config_.channel_layout() != channel_layout)) { |
| 375 // Clear config data so that a config change is initiated. | 375 // Clear config data so that a config change is initiated. |
| 376 config_ = AudioDecoderConfig(); | 376 config_ = AudioDecoderConfig(); |
| 377 } | 377 } |
| 378 | 378 |
| 379 if (!config_.IsValidConfig()) { | 379 if (!config_.IsValidConfig()) { |
| 380 config_.Initialize(kCodecMP3, kSampleFormatF32, channel_layout, | 380 config_.Initialize(kCodecMP3, kSampleFormatF32, channel_layout, |
| 381 sample_rate, NULL, 0, false, false); | 381 sample_rate, NULL, 0, false, false, |
| 382 base::TimeDelta(), base::TimeDelta()); |
| 382 | 383 |
| 383 base::TimeDelta base_timestamp; | 384 base::TimeDelta base_timestamp; |
| 384 if (timestamp_helper_) | 385 if (timestamp_helper_) |
| 385 base_timestamp = timestamp_helper_->GetTimestamp(); | 386 base_timestamp = timestamp_helper_->GetTimestamp(); |
| 386 | 387 |
| 387 timestamp_helper_.reset(new AudioTimestampHelper(sample_rate)); | 388 timestamp_helper_.reset(new AudioTimestampHelper(sample_rate)); |
| 388 timestamp_helper_->SetBaseTimestamp(base_timestamp); | 389 timestamp_helper_->SetBaseTimestamp(base_timestamp); |
| 389 | 390 |
| 390 VideoDecoderConfig video_config; | 391 VideoDecoderConfig video_config; |
| 391 bool success = config_cb_.Run(config_, video_config); | 392 bool success = config_cb_.Run(config_, video_config); |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 continue; | 557 continue; |
| 557 } | 558 } |
| 558 | 559 |
| 559 return candidate_start_code - data; | 560 return candidate_start_code - data; |
| 560 } | 561 } |
| 561 | 562 |
| 562 return 0; | 563 return 0; |
| 563 } | 564 } |
| 564 | 565 |
| 565 } // namespace media | 566 } // namespace media |
| OLD | NEW |