summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorskerner@chromium.org <skerner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-23 20:52:52 +0000
committerskerner@chromium.org <skerner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-23 20:52:52 +0000
commit8d72f27c759c723933dc0b1f79fbee57e1730f83 (patch)
tree1bcf46458ccce1221d4a6e15b79d05ede80a2a0c /media
parent9d5c04b29f4df0a6b6151f15ec942cf663f211f7 (diff)
downloadchromium_src-8d72f27c759c723933dc0b1f79fbee57e1730f83.zip
chromium_src-8d72f27c759c723933dc0b1f79fbee57e1730f83.tar.gz
chromium_src-8d72f27c759c723933dc0b1f79fbee57e1730f83.tar.bz2
Revert 70077 - Don't uninitialize FFmpegVideoDecodeEngine if we haven't initialized it.
BUG=67303 TEST=media_unittests Review URL: http://codereview.chromium.org/6046006 TBR=scherkus@chromium.org Review URL: http://codereview.chromium.org/5970011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70092 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r--media/filters/ffmpeg_video_decoder.cc6
-rw-r--r--media/filters/ffmpeg_video_decoder.h1
-rw-r--r--media/filters/ffmpeg_video_decoder_unittest.cc11
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.