Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Merge M51: "Fix audio glitch issue introduced by security fix for for…
Browse files Browse the repository at this point in the history
…mat changes."

The patch was comparing the new sample rate value versus itself instead
of the old sample rate value versus the new.

BUG=602731
TEST=no more stuttering.

Review URL: https://codereview.chromium.org/1879143004

Cr-Commit-Position: refs/heads/master@{#386887}
(cherry picked from commit f4e5aba)

Review URL: https://codereview.chromium.org/1886173002 .

Cr-Commit-Position: refs/branch-heads/2704@{#46}
Cr-Branched-From: 6e53600-refs/heads/master@{#386251}
  • Loading branch information
dalecurtis committed Apr 14, 2016
1 parent 45b5708 commit 199d980
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions media/filters/ffmpeg_audio_decoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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_;

Expand Down Expand Up @@ -330,7 +332,7 @@ bool FFmpegAudioDecoder::FFmpegDecode(
config_.extra_data(), config_.encryption_scheme(),
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_)
Expand Down

0 comments on commit 199d980

Please sign in to comment.