diff options
-rw-r--r-- | media/filters/ffmpeg_video_decoder.cc | 6 | ||||
-rw-r--r-- | media/filters/ffmpeg_video_decoder.h | 1 | ||||
-rw-r--r-- | media/filters/ffmpeg_video_decoder_unittest.cc | 11 |
3 files changed, 5 insertions, 13 deletions
diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc index bdaee8c..b3c21b944 100644 --- a/media/filters/ffmpeg_video_decoder.cc +++ b/media/filters/ffmpeg_video_decoder.cc @@ -97,7 +97,6 @@ void FFmpegVideoDecoder::Initialize(DemuxerStream* demuxer_stream, config.opaque_context = av_stream; config.width = width_; config.height = height_; - state_ = kInitializing; decode_engine_->Initialize(message_loop(), this, NULL, config); } @@ -140,10 +139,7 @@ void FFmpegVideoDecoder::Stop(FilterCallback* callback) { DCHECK(!uninitialize_callback_.get()); uninitialize_callback_.reset(callback); - if (state_ != kUnInitialized) - decode_engine_->Uninitialize(); - else - OnUninitializeComplete(); + decode_engine_->Uninitialize(); } void FFmpegVideoDecoder::OnUninitializeComplete() { diff --git a/media/filters/ffmpeg_video_decoder.h b/media/filters/ffmpeg_video_decoder.h index 76e60e8..617dfc1 100644 --- a/media/filters/ffmpeg_video_decoder.h +++ b/media/filters/ffmpeg_video_decoder.h @@ -72,7 +72,6 @@ class FFmpegVideoDecoder : public VideoDecoder, enum DecoderState { kUnInitialized, - kInitializing, kNormal, kFlushCodec, kDecodeFinished, diff --git a/media/filters/ffmpeg_video_decoder_unittest.cc b/media/filters/ffmpeg_video_decoder_unittest.cc index 779a48f..9c1cc4c 100644 --- a/media/filters/ffmpeg_video_decoder_unittest.cc +++ b/media/filters/ffmpeg_video_decoder_unittest.cc @@ -160,15 +160,12 @@ class FFmpegVideoDecoderTest : public testing::Test { } virtual ~FFmpegVideoDecoderTest() { + // We had to set this because not all tests had initialized the engine. + engine_->event_handler_ = decoder_.get(); EXPECT_CALL(callback_, OnFilterCallback()); EXPECT_CALL(callback_, OnCallbackDestroyed()); - - // The presence of an event handler means we need to uninitialize. - if (engine_->event_handler_) { - EXPECT_CALL(*engine_, Uninitialize()) - .WillOnce(EngineUninitialize(engine_)); - } - + EXPECT_CALL(*engine_, Uninitialize()) + .WillOnce(EngineUninitialize(engine_)); decoder_->Stop(callback_.NewCallback()); // Finish up any remaining tasks. |