From 24da0bdd190adf22b9d240d364f0c757717a5f5a Mon Sep 17 00:00:00 2001 From: "rockot@chromium.org" Date: Fri, 18 Apr 2014 16:13:19 +0000 Subject: Revert 264763 "Wire up codec_delay() to MP3StreamParser and FFmp..." Possible candidate for broken media_unittests: http://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%28dbg%29%281%29/builds/30043/steps/media_unittests/logs/MediaSource_MP3_TimestampOffset_0 > Wire up codec_delay() to MP3StreamParser and FFmpegAudioDecoder. > > Allows us to drop silent samples from the decoder after initialization > and resets. > > codec_delay() is always in frames, so I've changed all call sites to use > frames instead of a TimeDelta. > > Coincidentally also fixes an issue where not enough data was dropped from > Vorbis buffers with negative timestamps. > > BUG=360961 > TEST=new pipeline_integration_test > > Review URL: https://codereview.chromium.org/239423005 TBR=dalecurtis@chromium.org Review URL: https://codereview.chromium.org/242203006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264803 0039d316-1c4b-4281-b951-d872f2087c98 --- media/ffmpeg/ffmpeg_common.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'media/ffmpeg') diff --git a/media/ffmpeg/ffmpeg_common.cc b/media/ffmpeg/ffmpeg_common.cc index a65d19f..abc2a1a 100644 --- a/media/ffmpeg/ffmpeg_common.cc +++ b/media/ffmpeg/ffmpeg_common.cc @@ -298,6 +298,12 @@ static void AVCodecContextToAudioDecoderConfig( codec_context->seek_preroll * 1000000.0 / codec_context->sample_rate); } + base::TimeDelta codec_delay; + if (codec_context->delay > 0) { + codec_delay = base::TimeDelta::FromMicroseconds( + codec_context->delay * 1000000.0 / codec_context->sample_rate); + } + config->Initialize(codec, sample_format, channel_layout, @@ -307,7 +313,7 @@ static void AVCodecContextToAudioDecoderConfig( is_encrypted, record_stats, seek_preroll, - codec_context->delay); + codec_delay); if (codec != kCodecOpus) { DCHECK_EQ(av_get_bytes_per_sample(codec_context->sample_fmt) * 8, config->bits_per_channel()); -- cgit v1.1