Bug 1298217. Part 3 - Remove the check for IsShutdown() from CheckIfDecodeComplete() because it is called only when mState is DECODING or BUFFERING. draft
authorJW Wang <jwwang@mozilla.com>
Fri, 26 Aug 2016 06:06:20 +1200
changeset 406596 aefdc0ad3607a84effebc66c8865b559a471b924
parent 406595 a06ac309b2ecffc5843471b6345f93172defbd8b
child 406597 cb0362f9ec8946289e12ba8238d6ee0c884e0ef2
push id27772
push userjwwang@mozilla.com
push dateMon, 29 Aug 2016 06:35:00 +0000
bugs1298217
milestone51.0a1
Bug 1298217. Part 3 - Remove the check for IsShutdown() from CheckIfDecodeComplete() because it is called only when mState is DECODING or BUFFERING. MozReview-Commit-ID: 80eWIjZnLAO
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -823,24 +823,19 @@ MediaDecoderStateMachine::IsVideoDecodin
   MOZ_ASSERT(OnTaskQueue());
   return HasVideo() && !VideoQueue().IsFinished();
 }
 
 void
 MediaDecoderStateMachine::CheckIfDecodeComplete()
 {
   MOZ_ASSERT(OnTaskQueue());
-
-  if (IsShutdown() ||
-      mState == DECODER_STATE_SEEKING ||
-      mState == DECODER_STATE_COMPLETED) {
-    // Don't change our state if we've already been shutdown, or we're seeking,
-    // since we don't want to abort the shutdown or seek processes.
-    return;
-  }
+  MOZ_ASSERT(mState == DECODER_STATE_DECODING ||
+             mState == DECODER_STATE_BUFFERING);
+
   if (!IsVideoDecoding() && !IsAudioDecoding()) {
     // We've finished decoding all active streams,
     // so move to COMPLETED state.
     SetState(DECODER_STATE_COMPLETED);
     DispatchDecodeTasksIfNeeded();
     ScheduleStateMachine();
   }
   DECODER_LOG("CheckIfDecodeComplete %scompleted",