Bug 1299064. Part 3 - remove the calls to ScheduleStateMachine() following |SetState(DECODER_STATE_DECODING)|. r=kaku
authorJW Wang <jwwang@mozilla.com>
Tue, 30 Aug 2016 15:11:15 +0800
changeset 312003 0e3958b3ee0f5c11a9ef78a9480406f3fd04d113
parent 312002 437650642dd869c0d1bc14fff37d310226b36643
child 312004 a4204b1030f2ff5d369aba3dc57ef190239e2f66
push id31878
push userjwwang@mozilla.com
push dateWed, 31 Aug 2016 09:35:34 +0000
treeherderautoland@0e3958b3ee0f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskaku
bugs1299064
milestone51.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1299064. Part 3 - remove the calls to ScheduleStateMachine() following |SetState(DECODER_STATE_DECODING)|. r=kaku 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);
 }