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
--- 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",