Bug 1237174 - Remove the unnecessary code since mState won't change in the case of DECODER_STATE_COMPLETED. draft
authorJW Wang <jwwang@mozilla.com>
Wed, 06 Jan 2016 14:38:37 +0800
changeset 319173 1a605ec18da5d1d963f64bff44be0b470781428c
parent 319172 cd24b408ffa0c021df6161fefee2a087c8633cc2
child 512564 fb42d065bd7319a4c77307a5acb6283b7ff66dcf
push id8996
push userjwwang@mozilla.com
push dateWed, 06 Jan 2016 06:40:01 +0000
bugs1237174
milestone46.0a1
Bug 1237174 - Remove the unnecessary code since mState won't change in the case of DECODER_STATE_COMPLETED.
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -2347,23 +2347,16 @@ nsresult MediaDecoderStateMachine::RunSt
                      "Must have timer scheduled");
         return NS_OK;
       }
 
       // StopPlayback in order to reset the IsPlaying() state so audio
       // is restarted correctly.
       StopPlayback();
 
-      if (mState != DECODER_STATE_COMPLETED) {
-        // While we're presenting a frame we can change state. Whatever changed
-        // our state should have scheduled another state machine run.
-        NS_ASSERTION(IsStateMachineScheduled(), "Must have timer scheduled");
-        return NS_OK;
-      }
-
       if (mPlayState == MediaDecoder::PLAY_STATE_PLAYING &&
           !mSentPlaybackEndedEvent)
       {
         int64_t clockTime = std::max(AudioEndTime(), VideoEndTime());
         clockTime = std::max(int64_t(0), std::max(clockTime, Duration().ToMicroseconds()));
         UpdatePlaybackPosition(clockTime);
 
         // Ensure readyState is updated before firing the 'ended' event.