Bug 1299064. Part 3 - remove the calls to ScheduleStateMachine() following |SetState(DECODER_STATE_DECODING)|. draft
authorJW Wang <jwwang@mozilla.com>
Tue, 30 Aug 2016 15:11:15 +0800
changeset 407874 e4018097fe178a252e46a7a1787283ed7859f2a0
parent 407873 dc73b6ec26383cc85e5584fd914381c274116c52
child 407885 95903dbbbef092b7730a404538a1725a5ab76f24
push id28067
push userjwwang@mozilla.com
push dateWed, 31 Aug 2016 05:18:30 +0000
bugs1299064
milestone51.0a1
Bug 1299064. Part 3 - remove the calls to ScheduleStateMachine() following |SetState(DECODER_STATE_DECODING)|. Note nextState is either DECODER_STATE_COMPLETED or DECODER_STATE_DECODING in SeekCompleted(). Their entry actions call ScheduleStateMachine() directly or indirectly. MozReview-Commit-ID: DpDW7qtlogV
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -2019,18 +2019,16 @@ MediaDecoderStateMachine::OnMetadataRead
   if (waitingForCDM) {
     // Metadata parsing was successful but we're still waiting for CDM caps
     // to become available so that we can build the correct decryptor/decoder.
     SetState(DECODER_STATE_WAIT_FOR_CDM);
     return;
   }
 
   SetState(DECODER_STATE_DECODING);
-
-  ScheduleStateMachine();
 }
 
 void
 MediaDecoderStateMachine::OnMetadataNotRead(ReadMetadataFailureReason aReason)
 {
   MOZ_ASSERT(OnTaskQueue());
   MOZ_ASSERT(mState == DECODER_STATE_DECODING_METADATA);
   mMetadataRequest.Complete();
@@ -2193,17 +2191,17 @@ MediaDecoderStateMachine::SeekCompleted(
   mQuickBuffering = false;
 
   if (video) {
     mMediaSink->Redraw(mInfo.mVideo);
     mOnPlaybackEvent.Notify(MediaEventType::Invalidate);
   }
 
   SetState(nextState);
-  ScheduleStateMachine();
+  MOZ_ASSERT(IsStateMachineScheduled());
 }
 
 RefPtr<ShutdownPromise>
 MediaDecoderStateMachine::BeginShutdown()
 {
   return InvokeAsync(OwnerThread(), this, __func__,
                      &MediaDecoderStateMachine::Shutdown);
 }