Bug 1237174 - Remove the unnecessary code since mState won't change in the case of DECODER_STATE_COMPLETED. r=bechen.
authorJW Wang <jwwang@mozilla.com>
Wed, 06 Jan 2016 18:18:13 +0800
changeset 278898 f5ec5ef461dea96da81ece39f139cf222feab8df
parent 278897 f5e68d14fe28237dfa6fa254be61979f3455e661
child 278899 d4cf012ac235334cb77e83ef5e0d673c7269008b
push id29860
push usercbook@mozilla.com
push dateThu, 07 Jan 2016 10:51:20 +0000
treeherdermozilla-central@e0bcd16e1d4b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbechen
bugs1237174
milestone46.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1237174 - Remove the unnecessary code since mState won't change in the case of DECODER_STATE_COMPLETED. r=bechen.
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.