Bug 1381376 - only suspend decoding when the pref is on.
Only suspend decoding when the pref is on, but resuming could be done when the
pref is off.
MozReview-Commit-ID: JDh1pRXNhc8
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -3116,17 +3116,19 @@ void MediaDecoderStateMachine::SetVideoD
void MediaDecoderStateMachine::SetVideoDecodeModeInternal(VideoDecodeMode aMode)
{
MOZ_ASSERT(OnTaskQueue());
LOG("VideoDecodeModeChanged: VideoDecodeMode=(%s->%s), mVideoDecodeSuspended=%c",
mVideoDecodeMode == VideoDecodeMode::Normal ? "Normal" : "Suspend",
aMode == VideoDecodeMode::Normal ? "Normal" : "Suspend",
mVideoDecodeSuspended ? 'T' : 'F');
- if (!MediaPrefs::MDSMSuspendBackgroundVideoEnabled()) {
+ // Should not suspend decoding if we don't turn on the pref.
+ if (!MediaPrefs::MDSMSuspendBackgroundVideoEnabled() &&
+ aMode == VideoDecodeMode::Suspend) {
return;
}
if (aMode == mVideoDecodeMode) {
return;
}
// Set new video decode mode.