diff options
author | fgalligan@chromium.org <fgalligan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-09 19:05:14 +0000 |
---|---|---|
committer | fgalligan@chromium.org <fgalligan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-09 19:05:14 +0000 |
commit | 610db02a9a0a4f4bec8c9a4f4eb77b5d76be8fa0 (patch) | |
tree | f4afa5a097fbf71394a6a84faa9507655e32aebb /media | |
parent | df7eb49c9f3b288e5cc01c2e236febefe3fb120e (diff) | |
download | chromium_src-610db02a9a0a4f4bec8c9a4f4eb77b5d76be8fa0.zip chromium_src-610db02a9a0a4f4bec8c9a4f4eb77b5d76be8fa0.tar.gz chromium_src-610db02a9a0a4f4bec8c9a4f4eb77b5d76be8fa0.tar.bz2 |
The decoder filter pushes a pts for every video frame but it was not
popping the pts when the decoded frame had a valid timestamp. This
change will pop the pts queue when the decoder filter uses the
decoded frame's timestamp.
BUG=51434
TEST=Play any mp4 or ogg file with video and check to make sure
|pts_heap_| is empty when playback is finished.
Review URL: http://codereview.chromium.org/3040048
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55434 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/filters/ffmpeg_video_decoder.cc | 3 | ||||
-rw-r--r-- | media/filters/ffmpeg_video_decoder_unittest.cc | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc index 716c60d..4496505 100644 --- a/media/filters/ffmpeg_video_decoder.cc +++ b/media/filters/ffmpeg_video_decoder.cc @@ -224,6 +224,9 @@ FFmpegVideoDecoder::TimeTuple FFmpegVideoDecoder::FindPtsAndDuration( if (timestamp != StreamSample::kInvalidTimestamp && timestamp.ToInternalValue() != 0) { pts.timestamp = timestamp; + // We need to clean up the timestamp we pushed onto the |pts_heap|. + if (!pts_heap->IsEmpty()) + pts_heap->Pop(); } else if (!pts_heap->IsEmpty()) { // If the frame did not have pts, try to get the pts from the |pts_heap|. pts.timestamp = pts_heap->Top(); diff --git a/media/filters/ffmpeg_video_decoder_unittest.cc b/media/filters/ffmpeg_video_decoder_unittest.cc index 33b7f5a..228d3c8 100644 --- a/media/filters/ffmpeg_video_decoder_unittest.cc +++ b/media/filters/ffmpeg_video_decoder_unittest.cc @@ -344,6 +344,7 @@ TEST_F(FFmpegVideoDecoderTest, FindPtsAndDuration) { // Set a pts and duration on |video_frame_| and make sure it overrides // |pts_heap|. + pts_heap.Push(base::TimeDelta::FromMicroseconds(123)); video_frame_->SetTimestamp(base::TimeDelta::FromMicroseconds(456)); video_frame_->SetDuration(base::TimeDelta::FromMicroseconds(789)); result_pts = decoder_->FindPtsAndDuration(time_base, |