Bug 1300497. Part 4 - remove the call to ScheduleStateMachine() before |SetState(DECODER_STATE_SHUTDOWN)| and cancel mDelayedScheduler in Shutdown().
We don't want to run MDSM cycles anymore once shutdown begins.
MozReview-Commit-ID: 7Py20oqWNBG
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1222,22 +1222,20 @@ MediaDecoderStateMachine::SetDormant(boo
SetState(DECODER_STATE_DECODING_METADATA);
}
RefPtr<ShutdownPromise>
MediaDecoderStateMachine::Shutdown()
{
MOZ_ASSERT(OnTaskQueue());
- // Once we've entered the shutdown state here there's no going back.
- // Change state before issuing shutdown request to threads so those
- // threads can start exiting cleanly during the Shutdown call.
- ScheduleStateMachine();
SetState(DECODER_STATE_SHUTDOWN);
+ mDelayedScheduler.Reset();
+
mBufferedUpdateRequest.DisconnectIfExists();
mQueuedSeek.RejectIfExists(__func__);
DiscardSeekTaskIfExist();
// Shutdown happens will decode timer is active, we need to disconnect and
// dispose of the timer.