diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-19 20:53:32 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-19 20:53:32 +0000 |
commit | fd79350b30f237b096e4e434f909f3d82c0633f5 (patch) | |
tree | f07eca323cca8c71f959a1b21a345e0e755675d6 | |
parent | c468131fc71d1f3c3c393f8449a8cc55091843c7 (diff) | |
download | chromium_src-fd79350b30f237b096e4e434f909f3d82c0633f5.zip chromium_src-fd79350b30f237b096e4e434f909f3d82c0633f5.tar.gz chromium_src-fd79350b30f237b096e4e434f909f3d82c0633f5.tar.bz2 |
Revert 85965 - Introduce a quick and dirty hack to skip the implicit first seek for FFmpegDemuxer.
The real fix is to split Seek() into explicit Seek() and Preroll() actions as Seek() can have unintended consequences (i.e., resetting internal FFmpeg state).
BUG=40344,80187
TEST=media_unittests
Review URL: http://codereview.chromium.org/6894044
TBR=scherkus@chromium.org
Review URL: http://codereview.chromium.org/7051011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85967 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | media/filters/ffmpeg_demuxer.cc | 11 | ||||
-rw-r--r-- | media/filters/ffmpeg_demuxer.h | 7 | ||||
-rw-r--r-- | media/filters/ffmpeg_demuxer_unittest.cc | 2 |
3 files changed, 2 insertions, 18 deletions
diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc index 01a6681..8347019 100644 --- a/media/filters/ffmpeg_demuxer.cc +++ b/media/filters/ffmpeg_demuxer.cc @@ -264,8 +264,7 @@ FFmpegDemuxer::FFmpegDemuxer(MessageLoop* message_loop) last_read_bytes_(0), read_position_(0), max_duration_(base::TimeDelta::FromMicroseconds(-1)), - deferred_status_(PIPELINE_OK), - first_seek_hack_(true) { + deferred_status_(PIPELINE_OK) { DCHECK(message_loop_); } @@ -532,14 +531,6 @@ void FFmpegDemuxer::InitializeTask(DataSource* data_source, void FFmpegDemuxer::SeekTask(base::TimeDelta time, const FilterStatusCB& cb) { DCHECK_EQ(MessageLoop::current(), message_loop_); - // TODO(scherkus): remove this by separating Seek() from Flush() from - // Preroll() states (i.e., the implicit Seek(0) should really be a Preroll()). - if (first_seek_hack_) { - first_seek_hack_ = false; - callback->Run(); - return; - } - // Tell streams to flush buffers due to seeking. StreamVector::iterator iter; for (iter = streams_.begin(); iter != streams_.end(); ++iter) { diff --git a/media/filters/ffmpeg_demuxer.h b/media/filters/ffmpeg_demuxer.h index a651ee3..d96622c 100644 --- a/media/filters/ffmpeg_demuxer.h +++ b/media/filters/ffmpeg_demuxer.h @@ -161,9 +161,6 @@ class FFmpegDemuxer : public Demuxer, // Provide access to FFmpegDemuxerStream. MessageLoop* message_loop(); - // For testing purposes. - void disable_first_seek_hack_for_testing() { first_seek_hack_ = false; } - private: // Only allow a factory to create this class. friend class MockFFmpegDemuxer; @@ -249,10 +246,6 @@ class FFmpegDemuxer : public Demuxer, base::TimeDelta max_duration_; PipelineStatus deferred_status_; - // Used to skip the implicit "first seek" to avoid resetting FFmpeg's internal - // state. - bool first_seek_hack_; - DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); }; diff --git a/media/filters/ffmpeg_demuxer_unittest.cc b/media/filters/ffmpeg_demuxer_unittest.cc index 1234297..74ce0ed 100644 --- a/media/filters/ffmpeg_demuxer_unittest.cc +++ b/media/filters/ffmpeg_demuxer_unittest.cc @@ -66,7 +66,7 @@ class FFmpegDemuxerTest : public testing::Test { FFmpegDemuxerTest() { // Create an FFmpegDemuxer. demuxer_ = new FFmpegDemuxer(&message_loop_); - demuxer_->disable_first_seek_hack_for_testing(); + DCHECK(demuxer_); // Inject a filter host and message loop and prepare a data source. demuxer_->set_host(&host_); |