Bug 1298217. Part 7 - Assert |mState != DECODER_STATE_DECODING| in StartDecoding().
StartDecoding() is called from several places where mState is proven to be not DECODER_STATE_DECODING:
1. Called by PlayStateChanged() when mState is BUFFERING.
2. Called by OnMetadataRead() where mState is DECODING_METADATA.
3. Called by SeekCompleted() where mState is SEEKING.
4. Called by RunStateMachine() when the case is BUFFERING.
5. Called by OnCDMProxyReady() when mState is WAIT_FOR_CDM.
MozReview-Commit-ID: 53LWipLzdRo
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1254,19 +1254,17 @@ MediaDecoderStateMachine::Shutdown()
&MediaDecoderStateMachine::FinishShutdown,
&MediaDecoderStateMachine::FinishShutdown)
->CompletionPromise();
}
void MediaDecoderStateMachine::StartDecoding()
{
MOZ_ASSERT(OnTaskQueue());
- if (mState == DECODER_STATE_DECODING && !mDecodingFirstFrame) {
- return;
- }
+ MOZ_ASSERT(mState != DECODER_STATE_DECODING);
SetState(DECODER_STATE_DECODING);
if (mDecodingFirstFrame && mSentFirstFrameLoadedEvent) {
// We're resuming from dormant state, so we don't need to request
// the first samples in order to determine the media start time,
// we have the start time from last time we loaded.
// FinishDecodeFirstFrame will be launched upon completion of the seek when
// we have data ready to play.