Index: media/blink/webmediaplayer_impl.cc |
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc |
index a195bbffe433dd586df6ba14be3dffe79a5891dd..40b3a9f1c83fba28f48a3387dfd4235aa236f990 100644 |
--- a/media/blink/webmediaplayer_impl.cc |
+++ b/media/blink/webmediaplayer_impl.cc |
@@ -267,6 +267,9 @@ WebMediaPlayerImpl::WebMediaPlayerImpl( |
// e.g. GetCurrentFrameFromCompositor(). See http://crbug.com/434861 |
audio_source_provider_ = |
new WebAudioSourceProviderImpl(params.audio_renderer_sink(), media_log_); |
+ |
+ if (observer_) |
+ observer_->SetClient(this); |
} |
WebMediaPlayerImpl::~WebMediaPlayerImpl() { |
@@ -1838,7 +1841,7 @@ void WebMediaPlayerImpl::UpdatePlayState() { |
bool is_streaming = false; |
#else |
bool is_remote = false; |
- bool is_streaming = IsStreaming(); |
+ bool is_streaming = IsStreaming() || disable_pipeline_auto_suspend_; |
miu
2017/02/13 23:36:08
This |is_streaming| variable should probably be re
xjz
2017/02/14 01:46:10
Done.
|
#endif |
bool is_suspended = pipeline_controller_.IsSuspended(); |
@@ -2287,4 +2290,14 @@ void WebMediaPlayerImpl::ReportTimeFromForegroundToFirstFrame( |
} |
} |
+void WebMediaPlayerImpl::SwitchRenderer() { |
+ DCHECK(main_task_runner_->BelongsToCurrentThread()); |
+ ScheduleRestart(); |
+} |
+ |
+void WebMediaPlayerImpl::DisablePipelineAutoSuspend(bool disable) { |
+ DCHECK(main_task_runner_->BelongsToCurrentThread()); |
+ disable_pipeline_auto_suspend_ = disable; |
+} |
+ |
} // namespace media |