Bug 1284177 - P3: Fix ended event reporting for suspended video decode. r?jwwang
Suspended videos were blocking the video from completing.
MozReview-Commit-ID: 2eE97FEUMPu
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -838,16 +838,17 @@ MediaDecoderStateMachine::CheckIfDecodeC
if (IsShutdown() ||
mState == DECODER_STATE_SEEKING ||
mState == DECODER_STATE_COMPLETED) {
// Don't change our state if we've already been shutdown, or we're seeking,
// since we don't want to abort the shutdown or seek processes.
return;
}
+ // if ((!IsVideoDecoding() || IsVideoDecodeSuspended()) && !IsAudioDecoding()) {
if (!IsVideoDecoding() && !IsAudioDecoding()) {
// We've finished decoding all active streams,
// so move to COMPLETED state.
SetState(DECODER_STATE_COMPLETED);
DispatchDecodeTasksIfNeeded();
ScheduleStateMachine();
}
DECODER_LOG("CheckIfDecodeComplete %scompleted",
@@ -1320,17 +1321,17 @@ void MediaDecoderStateMachine::PlayState
ScheduleStateMachine();
}
void MediaDecoderStateMachine::VisibilityChanged()
{
MOZ_ASSERT(OnTaskQueue());
DECODER_LOG("VisibilityChanged: mIsVisible=%d, "
"mVideoDecodeSuspended=%d, mIsReaderSuspended=%d",
- mIsVisible.Ref(), mVideoDecodeSuspended, mIsReaderSuspended.Ref());
+ mIsVisible.Ref(), mVideoDecodeSuspended.Ref(), mIsReaderSuspended.Ref());
if (!HasVideo()) {
return;
}
// If not playing then there's nothing to do.
if (mPlayState != MediaDecoder::PLAY_STATE_PLAYING) {
return;