Bug 1355031 P2 - make sure that VideoOnlySeekBegin and VideoOnlySeekCompleted are always dispatched in pair; r?jwwang
MozReview-Commit-ID: FV03vlMtjS3
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1027,16 +1027,25 @@ public:
{
MOZ_ASSERT(aSeekJob.mTarget->IsAccurate() || aSeekJob.mTarget->IsFast());
mCurrentTimeBeforeSeek = mMaster->GetMediaTime();
return SeekingState::Enter(Move(aSeekJob), aVisibility);
}
void Exit() override
{
+ if (mSeekJob.Exists() &&
+ mSeekJob.mTarget.isSome() &&
+ mSeekJob.mTarget->IsVideoOnly()) {
+ // We are discarding this video-only seek operation now, and we still need
+ // to dispatch an event so that the UI can change in response to the end
+ // of video-only seek.
+ mMaster->mOnPlaybackEvent.Notify(MediaEventType::VideoOnlySeekCompleted);
+ }
+
// Disconnect MediaDecoder.
mSeekJob.RejectIfExists(__func__);
// Disconnect MediaDecoderReaderWrapper.
mSeekRequest.DisconnectIfExists();
mWaitRequest.DisconnectIfExists();
}