Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Unified Diff: media/renderers/video_renderer_impl.cc

Issue 1928083002: Ignore sink start attempts when no frames are present. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2717
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/null_video_sink_unittest.cc ('k') | media/renderers/video_renderer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/renderers/video_renderer_impl.cc
diff --git a/media/renderers/video_renderer_impl.cc b/media/renderers/video_renderer_impl.cc
index 148c4df63d383e628bd89f98e546b54d62b78117..6adc08dc76ffb16ff083641fa18981a088be4c3a 100644
--- a/media/renderers/video_renderer_impl.cc
+++ b/media/renderers/video_renderer_impl.cc
@@ -299,8 +299,17 @@ void VideoRendererImpl::OnTimeStateChanged(bool time_progressing) {
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();
+ if (rendered_end_of_stream_)
+ return;
+
+ // If we have no frames queued, there is a pending buffering state change in
+ // flight and we should ignore the start attempt.
+ if (!algorithm_->frames_queued()) {
+ DCHECK_EQ(buffering_state_, BUFFERING_HAVE_NOTHING);
+ return;
+ }
+
+ StartSink();
} else {
StopSink();
« no previous file with comments | « media/base/null_video_sink_unittest.cc ('k') | media/renderers/video_renderer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698