Bug 1378085 P3 - override Exit(); r?jwwang
MozReview-Commit-ID: 2NW9d4hu3bT
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1036,25 +1036,16 @@ 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();
}
@@ -1779,16 +1770,28 @@ public:
// Dispatch a mozvideoonlyseekbegin event to indicate UI for corresponding
// changes.
mMaster->mOnPlaybackEvent.Notify(MediaEventType::VideoOnlySeekBegin);
return p.forget();
}
+ void Exit() override
+ {
+ if (mSeekJob.Exists() &&
+ mSeekJob.mTarget.isSome()) {
+ // 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);
+ }
+
+ AccurateSeekingState::Exit();
+ }
};
RefPtr<MediaDecoder::SeekPromise>
MediaDecoderStateMachine::DormantState::HandleSeek(SeekTarget aTarget)
{
if (aTarget.IsNextFrame()) {
// NextFrameSeekingState doesn't reset the decoder unlike
// AccurateSeekingState. So we first must come out of dormant by seeking to