Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(905)

Unified Diff: media/filters/ffmpeg_audio_decoder.cc

Issue 1868983004: Fixing AudioBuffer params and channel layout bugs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Returning after pipeline error Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/renderers/audio_renderer_impl.cc » ('j') | media/renderers/audio_renderer_impl.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_audio_decoder.cc
diff --git a/media/filters/ffmpeg_audio_decoder.cc b/media/filters/ffmpeg_audio_decoder.cc
index b5dc7177655e033adc51c583d9035b08b2667b7d..be839bb14a6efd7887c900cbea5dcd2a696ae2de 100644
--- a/media/filters/ffmpeg_audio_decoder.cc
+++ b/media/filters/ffmpeg_audio_decoder.cc
@@ -300,10 +300,18 @@ bool FFmpegAudioDecoder::FFmpegDecode(
ChannelLayout channel_layout = ChannelLayoutToChromeChannelLayout(
codec_context_->channel_layout, codec_context_->channels);
- if (av_frame_->sample_rate != config_.samples_per_second() ||
- channel_layout != config_.channel_layout() ||
+ bool is_config_stale =
+ av_frame_->sample_rate != config_.samples_per_second() ||
channels != ChannelLayoutToChannelCount(config_.channel_layout()) ||
- av_frame_->format != av_sample_format_) {
+ av_frame_->format != av_sample_format_;
+
+ // Only consider channel layout changes for AAC.
+ // TODO(tguilbert, dalecurtis): Due to http://crbug.com/600538 we need to
+ // allow channel layout changes for the moment. See if ffmpeg is fixable.
chcunningham 2016/04/19 00:28:56 Just to confirm my understanding, we initially hav
tguilbert 2016/04/19 18:17:56 I do not know if this is a bug per-say in Ffmpeg.
+ if (config_.codec() == kCodecAAC)
+ is_config_stale |= channel_layout != config_.channel_layout();
+
+ if (is_config_stale) {
// Only allow midstream configuration changes for AAC. Sample format is
// not expected to change between AAC profiles.
if (config_.codec() == kCodecAAC &&
@@ -322,7 +330,8 @@ bool FFmpegAudioDecoder::FFmpegDecode(
config_.extra_data(), config_.encryption_scheme(),
config_.seek_preroll(), config_.codec_delay());
config_changed = true;
- ResetTimestampState();
+ if (av_frame_->sample_rate != config_.samples_per_second())
+ ResetTimestampState();
} else {
MEDIA_LOG(ERROR, media_log_)
<< "Unsupported midstream configuration change!"
« no previous file with comments | « no previous file | media/renderers/audio_renderer_impl.cc » ('j') | media/renderers/audio_renderer_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698