Chromium Code Reviews| Index: media/blink/webmediaplayer_impl.cc |
| diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc |
| index 954ccbd11c7b16516491f80faa5fa772d4b6ba89..222443112511b73d568a29bc2b77f45b68c97e16 100644 |
| --- a/media/blink/webmediaplayer_impl.cc |
| +++ b/media/blink/webmediaplayer_impl.cc |
| @@ -1458,11 +1458,12 @@ void WebMediaPlayerImpl::SetSuspendState(bool is_suspended) { |
| if (IsNetworkStateError(network_state_)) |
| return; |
| -#if defined(OS_MACOSX) || defined(OS_WIN) |
| - // TODO(sandersd): Idle suspend is disabled on OSX and Windows for hardware |
| - // decoding / opaque video frames since these frames are owned by the decoder |
| - // in the GPU process. http://crbug.com/595716 and http://crbug.com/602708 |
| if (can_suspend_state_ == CanSuspendState::UNKNOWN) { |
| +#if defined(OS_MACOSX) || defined(OS_WIN) |
| + // TODO(sandersd): Idle suspend is disabled on OSX and Windows for hardware |
| + // decoding / opaque video frames since these frames are owned by the |
| + // decoder in the GPU process. http://crbug.com/595716 and |
| + // http://crbug.com/602708 |
| scoped_refptr<VideoFrame> frame = GetCurrentFrameFromCompositor(); |
| if (frame) { |
| can_suspend_state_ = |
| @@ -1470,12 +1471,12 @@ void WebMediaPlayerImpl::SetSuspendState(bool is_suspended) { |
| ? CanSuspendState::NO |
| : CanSuspendState::YES; |
| } |
| - } |
| #else |
| - can_suspend_state_ = CanSuspendState::YES; |
| + can_suspend_state_ = CanSuspendState::YES; |
| #endif |
| + } |
| - if (can_suspend_state_ == CanSuspendState::NO) |
| + if (can_suspend_state_ == CanSuspendState::NO || !pipeline_.CanSuspend()) |
|
sandersd (OOO until July 31)
2016/05/23 18:41:58
We should probably allow Resume() even if the pipe
|
| return; |
| if (is_suspended) { |