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

Unified Diff: media/filters/ffmpeg_audio_decoder.cc

Issue 1889273003: Merge M50: "Fix audio glitch issue introduced by security fix for format changes." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: 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 | no next file » | no next file with comments »
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 ac9e957279e0063f45548f82521ed9830769e17f..d02251540eaf540204cd347651fd0c354ac048cd 100644
--- a/media/filters/ffmpeg_audio_decoder.cc
+++ b/media/filters/ffmpeg_audio_decoder.cc
@@ -300,8 +300,10 @@ bool FFmpegAudioDecoder::FFmpegDecode(
ChannelLayout channel_layout = ChannelLayoutToChromeChannelLayout(
codec_context_->channel_layout, codec_context_->channels);
+ bool is_sample_rate_change =
+ av_frame_->sample_rate != config_.samples_per_second();
bool is_config_stale =
- av_frame_->sample_rate != config_.samples_per_second() ||
+ is_sample_rate_change ||
channels != ChannelLayoutToChannelCount(config_.channel_layout()) ||
av_frame_->format != av_sample_format_;
@@ -330,7 +332,7 @@ bool FFmpegAudioDecoder::FFmpegDecode(
config_.extra_data(), config_.is_encrypted(),
config_.seek_preroll(), config_.codec_delay());
config_changed = true;
- if (av_frame_->sample_rate != config_.samples_per_second())
+ if (is_sample_rate_change)
ResetTimestampState();
} else {
MEDIA_LOG(ERROR, media_log_)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698