Bug 1298217. Part 10 - Assert |mState == DECODER_STATE_DECODING| in StartBuffering() which is only called by MaybeStartBuffering() which also asserts that. r=kaku
authorJW Wang <jwwang@mozilla.com>
Fri, 26 Aug 2016 06:34:06 +1200
changeset 311776 c48f06ea74fe743f965708c52fb8b57aec81d1ae
parent 311775 a10febe05935aa32bad84783cf96d01bdfbb7bca
child 311777 57a2f1d5bc60a09e4ba4e2209dd4fedc2febb662
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 10 - Assert |mState == DECODER_STATE_DECODING| in StartBuffering() which is only called by MaybeStartBuffering() which also asserts that. r=kaku MozReview-Commit-ID: BhcNiiQZX3I
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -2564,25 +2564,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