diff options
author | xhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-01 05:22:51 +0000 |
---|---|---|
committer | xhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-01 05:22:51 +0000 |
commit | b9de37bbc2d381e4a336da58a346e86195228356 (patch) | |
tree | 6fb980e4d505ed29ed8fbb2d72ba937037813898 /media | |
parent | 90eb75f32335e55450898e27912743f75bde3605 (diff) | |
download | chromium_src-b9de37bbc2d381e4a336da58a346e86195228356.zip chromium_src-b9de37bbc2d381e4a336da58a346e86195228356.tar.gz chromium_src-b9de37bbc2d381e4a336da58a346e86195228356.tar.bz2 |
ChunkDemuxer: Allow StartWaitingForSeek() to be called in PARSE_ERROR state.
BUG=263279
TEST=Added test passes without firing DCHECK.
Review URL: https://chromiumcodereview.appspot.com/21413003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214960 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/filters/chunk_demuxer.cc | 5 | ||||
-rw-r--r-- | media/filters/chunk_demuxer_unittest.cc | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/media/filters/chunk_demuxer.cc b/media/filters/chunk_demuxer.cc index 6e360bb..6f45a1f 100644 --- a/media/filters/chunk_demuxer.cc +++ b/media/filters/chunk_demuxer.cc @@ -837,10 +837,11 @@ TimeDelta ChunkDemuxer::GetStartTime() const { void ChunkDemuxer::StartWaitingForSeek(TimeDelta seek_time) { DVLOG(1) << "StartWaitingForSeek()"; base::AutoLock auto_lock(lock_); - DCHECK(state_ == INITIALIZED || state_ == ENDED || state_ == SHUTDOWN); + DCHECK(state_ == INITIALIZED || state_ == ENDED || state_ == SHUTDOWN || + state_ == PARSE_ERROR) << state_; DCHECK(seek_cb_.is_null()); - if (state_ == SHUTDOWN) + if (state_ == SHUTDOWN || state_ == PARSE_ERROR) return; AbortPendingReads(); diff --git a/media/filters/chunk_demuxer_unittest.cc b/media/filters/chunk_demuxer_unittest.cc index 07e7c6c..8719f87 100644 --- a/media/filters/chunk_demuxer_unittest.cc +++ b/media/filters/chunk_demuxer_unittest.cc @@ -2746,4 +2746,12 @@ TEST_F(ChunkDemuxerTest, AppendWindow) { CheckExpectedRanges(kSourceId, "{ [120,300) [420,660) }"); } +TEST_F(ChunkDemuxerTest, StartWaitingForSeekAfterParseError) { + ASSERT_TRUE(InitDemuxer(true, true)); + EXPECT_CALL(host_, OnDemuxerError(PIPELINE_ERROR_DECODE)); + AppendGarbage(); + base::TimeDelta seek_time = base::TimeDelta::FromSeconds(50); + demuxer_->StartWaitingForSeek(seek_time); +} + } // namespace media |