Bug 1298217. Part 7 - Assert |mState != DECODER_STATE_DECODING| in StartDecoding(). r=kaku
authorJW Wang <jwwang@mozilla.com>
Mon, 29 Aug 2016 11:36:26 +0800
changeset 311773 8d191355cb13769a9af75515fd33d6b624459ea4
parent 311772 b06577b71a3eaf7a31270f8ae22ff2c4a39704f7
child 311774 21020a8a6ea7fedbf1520411570c0e9b026c43e4
push id20417
push userryanvm@gmail.com
push dateTue, 30 Aug 2016 13:55:34 +0000
treeherderfx-team@b18c8bcdc116 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskaku
bugs1298217
milestone51.0a1
Bug 1298217. Part 7 - Assert |mState != DECODER_STATE_DECODING| in StartDecoding(). r=kaku 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
@@ -1252,19 +1252,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.