Bug 1298217. Part 7 - Assert |mState != DECODER_STATE_DECODING| in StartDecoding(). draft
authorJW Wang <jwwang@mozilla.com>
Mon, 29 Aug 2016 11:36:26 +0800
changeset 406600 7ffcbf4ca19705722bacfa2a534094463c240818
parent 406599 7d4ec09265558221cd8a4bfa14168fe8df965988
child 406601 7b6afa7870103e2a2b47132edc363b1e465a7ba4
push id27772
push userjwwang@mozilla.com
push dateMon, 29 Aug 2016 06:35:00 +0000
bugs1298217
milestone51.0a1
Bug 1298217. Part 7 - Assert |mState != DECODER_STATE_DECODING| in StartDecoding(). StartDecoding() is called from several places where mState is proven to be not DECODER_STATE_DECODING: 1. Called by PlayStateChanged() when mState is BUFFERING. 2. Called by OnMetadataRead() where mState is DECODING_METADATA. 3. Called by SeekCompleted() where mState is SEEKING. 4. Called by RunStateMachine() when the case is BUFFERING. 5. Called by OnCDMProxyReady() when mState is WAIT_FOR_CDM. MozReview-Commit-ID: 53LWipLzdRo
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1254,19 +1254,17 @@ MediaDecoderStateMachine::Shutdown()
            &MediaDecoderStateMachine::FinishShutdown,
            &MediaDecoderStateMachine::FinishShutdown)
     ->CompletionPromise();
 }
 
 void MediaDecoderStateMachine::StartDecoding()
 {
   MOZ_ASSERT(OnTaskQueue());
-  if (mState == DECODER_STATE_DECODING && !mDecodingFirstFrame) {
-    return;
-  }
+  MOZ_ASSERT(mState != DECODER_STATE_DECODING);
   SetState(DECODER_STATE_DECODING);
 
   if (mDecodingFirstFrame && mSentFirstFrameLoadedEvent) {
     // We're resuming from dormant state, so we don't need to request
     // the first samples in order to determine the media start time,
     // we have the start time from last time we loaded.
     // FinishDecodeFirstFrame will be launched upon completion of the seek when
     // we have data ready to play.