diff options
author | rockot@chromium.org <rockot@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-18 16:13:19 +0000 |
---|---|---|
committer | rockot@chromium.org <rockot@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-18 16:13:19 +0000 |
commit | 24da0bdd190adf22b9d240d364f0c757717a5f5a (patch) | |
tree | ae515c4bc5b2d5e53b5bb2515b491df1d5a546b5 /media/ffmpeg | |
parent | dc5662c95d6bbf3532bd91aa1ee4e5cbd890dc35 (diff) | |
download | chromium_src-24da0bdd190adf22b9d240d364f0c757717a5f5a.zip chromium_src-24da0bdd190adf22b9d240d364f0c757717a5f5a.tar.gz chromium_src-24da0bdd190adf22b9d240d364f0c757717a5f5a.tar.bz2 |
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
Diffstat (limited to 'media/ffmpeg')
-rw-r--r-- | media/ffmpeg/ffmpeg_common.cc | 8 |
1 files changed, 7 insertions, 1 deletions
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()); |