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

Unified Diff: media/blink/webmediaplayer_impl.cc

Issue 2449873006: Don't background pause suspend until we have future data. (Closed)
Patch Set: Add tests. Created 4 years, 2 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
Index: media/blink/webmediaplayer_impl.cc
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
index fdb43c9b95f20f2f20306af96881bb45bbe2a27d..fab1b65efba6e537cfe25fa9c136d85b05959b03 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -1756,7 +1756,10 @@ WebMediaPlayerImpl::UpdatePlayState_ComputePlayState(bool is_remote,
delegate_ && delegate_->IsPlayingBackgroundVideo();
bool background_suspended = is_backgrounded_video &&
!(can_play_backgrounded && is_background_playing);
- bool background_pause_suspended = is_backgrounded && paused_;
+ // Only suspend for pause in the background if we have future data, otherwise
+ // we may miss out on legitimate background playback attempts.
sandersd (OOO until July 31) 2016/10/26 23:07:46 The comment is slightly confusing since we can sti
DaleCurtis 2016/10/27 00:36:39 Reworded.
+ bool background_pause_suspended =
+ is_backgrounded && paused_ && have_future_data;
// TODO(sandersd): Make the delegate suspend idle players immediately when
// hidden.
« no previous file with comments | « no previous file | media/blink/webmediaplayer_impl_unittest.cc » ('j') | media/blink/webmediaplayer_impl_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698