Bug 1294615. Part 1 - Assert mQueuedSeek.Exists() is false in InitiateSeek().
InitiateSeek() is called from several places where we can prove mQueuedSeek.Exists() is false:
1. MaybeFinishDecodeFirstFrame(): mQueuedSeek is moved when calling InitiateSeek().
2. Seek() rejects mQueuedSeek before calling InitiateSeek().
3. StartDecoding(): mQueuedSeek is moved when calling InitiateSeek().
4. VisibilityChanged(): it doesn't call InitiateSeek() when mQueuedSeek.Exists() is true.
MozReview-Commit-ID: BriPw0VID5O
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1603,16 +1603,17 @@ MediaDecoderStateMachine::InitiateSeek(S
}
// Do the seek.
mSeekTaskRequest.Begin(mSeekTask->Seek(Duration())
->Then(OwnerThread(), __func__, this,
&MediaDecoderStateMachine::OnSeekTaskResolved,
&MediaDecoderStateMachine::OnSeekTaskRejected));
+ MOZ_ASSERT(!mQueuedSeek.Exists());
MOZ_ASSERT(!mCurrentSeek.Exists());
mCurrentSeek = Move(aSeekJob);
return mCurrentSeek.mPromise.Ensure(__func__);
}
void
MediaDecoderStateMachine::OnSeekTaskResolved(SeekTaskResolveValue aValue)
{