Bug 1349097 P1 - don't switch to SEEKING state while resuming video decoder in COMPLETED state; r?jwwang
Since the palyback had ended, don't bother to resume decoder and seek,
but still need to pass information to reader.
MozReview-Commit-ID: YdTpULK3XD
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1876,16 +1876,29 @@ public:
void HandlePlayStateChanged(MediaDecoder::PlayState aPlayState) override
{
if (aPlayState == MediaDecoder::PLAY_STATE_PLAYING) {
// Schedule Step() to check if we can start playback.
mMaster->ScheduleStateMachine();
}
}
+ void HandleResumeVideoDecoding() override
+ {
+ // The playback had ended, and we don't need to "resume" the video decoder
+ // anymore which means we don't need to switch to SEEKING state.
+ // However, we still need to notify the reader that we don't want to suspend
+ // video decoder anymore, so that the reader will create a standard video
+ // decoder next time the playback is restarted again.
+ MOZ_ASSERT(mMaster->mVideoDecodeSuspended);
+ mMaster->mVideoDecodeSuspended = false;
+ mMaster->mOnPlaybackEvent.Notify(MediaEventType::ExitVideoSuspend);
+ Reader()->SetVideoBlankDecode(false);
+ }
+
private:
bool mSentPlaybackEndedEvent = false;
};
/**
* Purpose: release all resources allocated by MDSM.
*
* Transition to: