diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-12 07:24:49 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-12 07:24:49 +0000 |
commit | 5dab3cc5b997dedf9c9f7dbe94dd099c53444cde (patch) | |
tree | ae9512af432ddab74ae1730414ee83524d266d7a | |
parent | 756c15a179c4f07316f1391105c0f0e382a7d458 (diff) | |
download | chromium_src-5dab3cc5b997dedf9c9f7dbe94dd099c53444cde.zip chromium_src-5dab3cc5b997dedf9c9f7dbe94dd099c53444cde.tar.gz chromium_src-5dab3cc5b997dedf9c9f7dbe94dd099c53444cde.tar.bz2 |
Fix A/V sync regression caused by not queueing video timestamps properly.
Review URL: http://codereview.chromium.org/118519
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18262 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | media/filters/ffmpeg_video_decoder.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc index 250bc70..4262068 100644 --- a/media/filters/ffmpeg_video_decoder.cc +++ b/media/filters/ffmpeg_video_decoder.cc @@ -111,6 +111,15 @@ void FFmpegVideoDecoder::OnDecode(Buffer* buffer) { << buffer->GetDataSize() << " bytes"; } + // We queue all incoming timestamps as long as decoding succeeded and it's not + // end of stream. + if (!buffer->IsEndOfStream()) { + TimeTuple times; + times.timestamp = buffer->GetTimestamp(); + times.duration = buffer->GetDuration(); + time_queue_.push(times); + } + // Check for a decoded frame instead of checking the return value of // avcodec_decode_video(). We don't need to stop the pipeline on // decode errors. @@ -128,12 +137,6 @@ void FFmpegVideoDecoder::OnDecode(Buffer* buffer) { return; } - // Queue the incoming timestamp only if we can decode the frame successfully. - TimeTuple times; - times.timestamp = buffer->GetTimestamp(); - times.duration = buffer->GetDuration(); - time_queue_.push(times); - // J (Motion JPEG) versions of YUV are full range 0..255. // Regular (MPEG) YUV is 16..240. // For now we will ignore the distinction and treat them the same. |