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

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: Fixing typos 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..3b5becfce09cfc1a7f0c520a59391694e87ed334 100644
--- a/media/filters/ffmpeg_audio_decoder.cc
+++ b/media/filters/ffmpeg_audio_decoder.cc
@@ -300,10 +300,17 @@ 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 config_is_stale =
DaleCurtis 2016/04/07 20:05:04 Naming style in chrome is typically "is_config_sta
tguilbert 2016/04/07 21:08:50 Done.
+ 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.
DaleCurtis 2016/04/07 20:05:04 Add a comment why, something like: // TODO(tguilb
tguilbert 2016/04/07 21:08:50 Done.
+ if(config_.codec() == kCodecAAC){
DaleCurtis 2016/04/07 20:05:04 run git cl format to fix formatting errors. notabl
tguilbert 2016/04/07 21:08:50 Done.
+ config_is_stale |= channel_layout != config_.channel_layout();
+ }
+
+ if (config_is_stale) {
// Only allow midstream configuration changes for AAC. Sample format is
// not expected to change between AAC profiles.
if (config_.codec() == kCodecAAC &&
« 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