Bug 1298217. Part 10 - Assert |mState == DECODER_STATE_DECODING| in StartBuffering() which is only called by MaybeStartBuffering() which also asserts that. draft
authorJW Wang <jwwang@mozilla.com>
Fri, 26 Aug 2016 06:34:06 +1200
changeset 406603 52a67e88e9f6c10ae3201439de9a078f485e0edf
parent 406602 daf935dd80cfdbe95cd18cfb3d402c62d695a701
child 406604 2abe85fe914097f6d766f4a3335defa520f30527
push id27772
push userjwwang@mozilla.com
push dateMon, 29 Aug 2016 06:35:00 +0000
bugs1298217
milestone51.0a1
Bug 1298217. Part 10 - Assert |mState == DECODER_STATE_DECODING| in StartBuffering() which is only called by MaybeStartBuffering() which also asserts that. MozReview-Commit-ID: BhcNiiQZX3I
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -2560,25 +2560,17 @@ MediaDecoderStateMachine::GetStatistics(
   result.mDecoderPosition = mDecoderPosition;
   result.mPlaybackPosition = mPlaybackOffset;
   return result;
 }
 
 void MediaDecoderStateMachine::StartBuffering()
 {
   MOZ_ASSERT(OnTaskQueue());
-
-  if (mState != DECODER_STATE_DECODING) {
-    // We only move into BUFFERING state if we're actually decoding.
-    // If we're currently doing something else, we don't need to buffer,
-    // and more importantly, we shouldn't overwrite mState to interrupt
-    // the current operation, as that could leave us in an inconsistent
-    // state!
-    return;
-  }
+  MOZ_ASSERT(mState == DECODER_STATE_DECODING);
 
   if (IsPlaying()) {
     StopPlayback();
   }
 
   TimeDuration decodeDuration = TimeStamp::Now() - mDecodeStartTime;
   // Go into quick buffering mode provided we've not just left buffering using
   // a "quick exit". This stops us flip-flopping between playing and buffering