Bug 1355031 P1 - adjust the event order; r?jwwang
(EnterVideoSuspend/ExitVideoSuspend) event pair and (VideoOnlySeekBegin/VideoOnlySeekCompleted) event pair should not interleave each other.
MozReview-Commit-ID: HehMIls11nc
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -939,31 +939,31 @@ class MediaDecoderStateMachine::SeekingS
public:
explicit SeekingState(Master* aPtr) : StateObject(aPtr) { }
RefPtr<MediaDecoder::SeekPromise> Enter(SeekJob&& aSeekJob,
EventVisibility aVisibility)
{
mSeekJob = Move(aSeekJob);
- // Dispatch a mozvideoonlyseekbegin event to indicate UI for corresponding
- // changes.
- if (mSeekJob.mTarget->IsVideoOnly()) {
- mMaster->mOnPlaybackEvent.Notify(MediaEventType::VideoOnlySeekBegin);
- }
-
// Always switch off the blank decoder otherwise we might become visible
// in the middle of seeking and won't have a valid video frame to show
// when seek is done.
if (mMaster->mVideoDecodeSuspended) {
mMaster->mVideoDecodeSuspended = false;
mMaster->mOnPlaybackEvent.Notify(MediaEventType::ExitVideoSuspend);
Reader()->SetVideoBlankDecode(false);
}
+ // Dispatch a mozvideoonlyseekbegin event to indicate UI for corresponding
+ // changes.
+ if (mSeekJob.mTarget->IsVideoOnly()) {
+ mMaster->mOnPlaybackEvent.Notify(MediaEventType::VideoOnlySeekBegin);
+ }
+
// Don't stop playback for a video-only seek since audio is playing.
if (!mSeekJob.mTarget->IsVideoOnly()) {
mMaster->StopPlayback();
}
mMaster->UpdatePlaybackPositionInternal(mSeekJob.mTarget->GetTime());
if (aVisibility == EventVisibility::Observable) {