diff options
author | dalecurtis <dalecurtis@chromium.org> | 2015-05-06 19:32:22 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-07 02:33:05 +0000 |
commit | 67314612a2fca488205d44b4d6911e2a29578539 (patch) | |
tree | 0c85e7989b177c403cebc42372cf939de471479b /media | |
parent | 7512409dce8eb4141c5d6886fbd47eda816375a0 (diff) | |
download | chromium_src-67314612a2fca488205d44b4d6911e2a29578539.zip chromium_src-67314612a2fca488205d44b4d6911e2a29578539.tar.gz chromium_src-67314612a2fca488205d44b4d6911e2a29578539.tar.bz2 |
Handle OnTimeStateChanged() after an EOS has been delivered.
The renderer has not yet received the ended callback and if we just
maintain HAVE_NOTHING, the renderer never exits preroll, so instead
just ignore time state changes after rendering eos.
BUG=485324
TEST=new test
Review URL: https://codereview.chromium.org/1126293005
Cr-Commit-Position: refs/heads/master@{#328686}
Diffstat (limited to 'media')
-rw-r--r-- | media/renderers/video_renderer_impl.cc | 10 | ||||
-rw-r--r-- | media/renderers/video_renderer_impl_unittest.cc | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/media/renderers/video_renderer_impl.cc b/media/renderers/video_renderer_impl.cc index e73b878..c586ab2 100644 --- a/media/renderers/video_renderer_impl.cc +++ b/media/renderers/video_renderer_impl.cc @@ -391,10 +391,14 @@ void VideoRendererImpl::OnTimeStateChanged(bool time_progressing) { if (!use_new_video_renderering_path_ || sink_started_ == time_progressing_) return; - if (time_progressing_) - StartSink(); - else + if (time_progressing_) { + // If only an EOS frame came in after a seek, the renderer may not have + // received the ended event yet though we've posted it. + if (!rendered_end_of_stream_) + StartSink(); + } else { StopSink(); + } } void VideoRendererImpl::PaintNextReadyFrame_Locked() { diff --git a/media/renderers/video_renderer_impl_unittest.cc b/media/renderers/video_renderer_impl_unittest.cc index b139c30..c77fc74 100644 --- a/media/renderers/video_renderer_impl_unittest.cc +++ b/media/renderers/video_renderer_impl_unittest.cc @@ -386,6 +386,8 @@ TEST_P(VideoRendererImplTest, InitializeAndEndOfStream) { SatisfyPendingReadWithEndOfStream(); event.RunAndWait(); } + // Firing a time state changed to true should be ignored... + renderer_->OnTimeStateChanged(true); EXPECT_FALSE(null_video_sink_->is_started()); Destroy(); } |