diff options
author | jiesun@google.com <jiesun@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-19 17:34:00 +0000 |
---|---|---|
committer | jiesun@google.com <jiesun@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-19 17:34:00 +0000 |
commit | 645951f0986cdaf3d8162f145b92b13a1a7ad526 (patch) | |
tree | 27f36af0c344650b7588b2dfc661bc77c007bd70 /media | |
parent | 12893c317ae3887de59727df0de45faae3f660e6 (diff) | |
download | chromium_src-645951f0986cdaf3d8162f145b92b13a1a7ad526.zip chromium_src-645951f0986cdaf3d8162f145b92b13a1a7ad526.tar.gz chromium_src-645951f0986cdaf3d8162f145b92b13a1a7ad526.tar.bz2 |
fix windows loop problem.
turns out filters are flushed from upstream to downstream...
BUG=52605
TEST=windows
Review URL: http://codereview.chromium.org/3107023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56706 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/filters/ffmpeg_video_decoder.cc | 18 | ||||
-rw-r--r-- | media/filters/ffmpeg_video_decoder_unittest.cc | 8 |
2 files changed, 12 insertions, 14 deletions
diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc index 7d73cc8..82c8007 100644 --- a/media/filters/ffmpeg_video_decoder.cc +++ b/media/filters/ffmpeg_video_decoder.cc @@ -174,12 +174,6 @@ void FFmpegVideoDecoder::OnFlushComplete() { DCHECK(flush_callback_.get()); AutoCallbackRunner done_runner(flush_callback_.release()); - - // Since we are sending Flush() in reverse order of filter. (i.e. flushing - // renderer before decoder). we could guaranteed the following invariant. - // TODO(jiesun): when we move to parallel Flush, we should remove this. - DCHECK_EQ(0u, pending_reads_) << "Pending reads should have completed"; - DCHECK_EQ(0u, pending_requests_) << "Pending requests should be empty"; } void FFmpegVideoDecoder::Seek(base::TimeDelta time, @@ -196,6 +190,10 @@ void FFmpegVideoDecoder::Seek(base::TimeDelta time, DCHECK_EQ(MessageLoop::current(), message_loop()); DCHECK(!seek_callback_.get()); + // TODO(jiesun): when we move to parallel Flush, we should remove this. + DCHECK_EQ(0u, pending_reads_) << "Pending reads should have completed"; + DCHECK_EQ(0u, pending_requests_) << "Pending requests should be empty"; + seek_callback_.reset(callback); decode_engine_->Seek(); } @@ -349,11 +347,9 @@ void FFmpegVideoDecoder::OnEmptyBufferCallback( DCHECK_EQ(MessageLoop::current(), message_loop()); DCHECK_LE(pending_reads_, pending_requests_); - if (state_ != kDecodeFinished) { - demuxer_stream_->Read( - NewCallback(this, &FFmpegVideoDecoder::OnReadComplete)); - ++pending_reads_; - } + demuxer_stream_->Read( + NewCallback(this, &FFmpegVideoDecoder::OnReadComplete)); + ++pending_reads_; } FFmpegVideoDecoder::TimeTuple FFmpegVideoDecoder::FindPtsAndDuration( diff --git a/media/filters/ffmpeg_video_decoder_unittest.cc b/media/filters/ffmpeg_video_decoder_unittest.cc index 521ca9b..90a538f 100644 --- a/media/filters/ffmpeg_video_decoder_unittest.cc +++ b/media/filters/ffmpeg_video_decoder_unittest.cc @@ -383,8 +383,10 @@ ACTION_P3(DecodeComplete, decoder, video_frame, time_tuple) { } ACTION_P2(DecodeNotComplete, decoder, buffer) { scoped_refptr<VideoFrame> null_frame; - decoder->OnFillBufferCallback(null_frame); - decoder->OnEmptyBufferCallback(buffer); + if (buffer->IsEndOfStream()) // We had started flushing. + decoder->OnFillBufferCallback(null_frame); + else + decoder->OnEmptyBufferCallback(buffer); } ACTION_P(ConsumePTS, pts_heap) { @@ -434,7 +436,7 @@ TEST_F(FFmpegVideoDecoderTest, DoDecode_TestStateTransition) { .WillOnce(DecodeNotComplete(decoder_.get(), buffer_)) .WillOnce(DecodeComplete(decoder_.get(), video_frame_, kTestPts2)) .WillOnce(DecodeComplete(decoder_.get(), video_frame_, kTestPts3)) - .WillOnce(DecodeNotComplete(decoder_.get(), buffer_)); + .WillOnce(DecodeNotComplete(decoder_.get(), end_of_stream_buffer_)); EXPECT_CALL(*renderer_.get(), FillThisBufferDone(_)) .Times(4); |