OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/filters/ffmpeg_audio_decoder.h" | 5 #include "media/filters/ffmpeg_audio_decoder.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/location.h" | 9 #include "base/location.h" |
10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
391 DCHECK_EQ(codec_context_->codec_id, AV_CODEC_ID_VORBIS); | 391 DCHECK_EQ(codec_context_->codec_id, AV_CODEC_ID_VORBIS); |
392 output_timestamp_helper_->SetBaseTimestamp(base::TimeDelta()); | 392 output_timestamp_helper_->SetBaseTimestamp(base::TimeDelta()); |
393 } else { | 393 } else { |
394 output_timestamp_helper_->SetBaseTimestamp(input->GetTimestamp()); | 394 output_timestamp_helper_->SetBaseTimestamp(input->GetTimestamp()); |
395 } | 395 } |
396 } | 396 } |
397 | 397 |
398 int decoded_audio_size = 0; | 398 int decoded_audio_size = 0; |
399 if (frame_decoded) { | 399 if (frame_decoded) { |
400 if (av_frame_->sample_rate != samples_per_second_ || | 400 if (av_frame_->sample_rate != samples_per_second_ || |
401 #ifdef CHROMIUM_NO_AVFRAME_CHANNELS | |
DaleCurtis
2013/04/17 22:14:23
Ditto.
Paweł Hajdan Jr.
2013/04/18 17:27:10
Done.
| |
402 av_get_channel_layout_nb_channels( | |
403 av_frame_->channel_layout) != channels_ || | |
404 #else | |
401 av_frame_->channels != channels_ || | 405 av_frame_->channels != channels_ || |
406 #endif | |
402 av_frame_->format != av_sample_format_) { | 407 av_frame_->format != av_sample_format_) { |
403 DLOG(ERROR) << "Unsupported midstream configuration change!" | 408 DLOG(ERROR) << "Unsupported midstream configuration change!" |
404 << " Sample Rate: " << av_frame_->sample_rate << " vs " | 409 << " Sample Rate: " << av_frame_->sample_rate << " vs " |
405 << samples_per_second_ | 410 << samples_per_second_ |
411 #ifdef CHROMIUM_NO_AVFRAME_CHANNELS | |
412 << ", Channels: " << av_get_channel_layout_nb_channels( | |
413 av_frame_->channel_layout) << " vs " | |
414 #else | |
406 << ", Channels: " << av_frame_->channels << " vs " | 415 << ", Channels: " << av_frame_->channels << " vs " |
416 #endif | |
407 << channels_ | 417 << channels_ |
408 << ", Sample Format: " << av_frame_->format << " vs " | 418 << ", Sample Format: " << av_frame_->format << " vs " |
409 << av_sample_format_; | 419 << av_sample_format_; |
410 | 420 |
411 // This is an unrecoverable error, so bail out. | 421 // This is an unrecoverable error, so bail out. |
412 QueuedAudioBuffer queue_entry = { kDecodeError, NULL }; | 422 QueuedAudioBuffer queue_entry = { kDecodeError, NULL }; |
413 queued_audio_.push_back(queue_entry); | 423 queued_audio_.push_back(queue_entry); |
414 break; | 424 break; |
415 } | 425 } |
416 | 426 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
491 // Decoding finished successfully, update statistics. | 501 // Decoding finished successfully, update statistics. |
492 if (result > 0) { | 502 if (result > 0) { |
493 PipelineStatistics statistics; | 503 PipelineStatistics statistics; |
494 statistics.audio_bytes_decoded = result; | 504 statistics.audio_bytes_decoded = result; |
495 statistics_cb_.Run(statistics); | 505 statistics_cb_.Run(statistics); |
496 } | 506 } |
497 } while (packet.size > 0); | 507 } while (packet.size > 0); |
498 } | 508 } |
499 | 509 |
500 } // namespace media | 510 } // namespace media |
OLD | NEW |