Bug 1237174 - Remove the unnecessary code since mState won't change in the case of DECODER_STATE_COMPLETED.
--- 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.