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

--HG--
extra : rebase_source : a667443b60524853c76b2a5155f45ae289a4be5b
This commit is contained in:
Kaku Kuo 2017-04-10 17:32:39 +08:00
parent 40b981616a
commit 0c93125075

View File

@ -944,12 +944,6 @@ public:
{
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.
@ -959,6 +953,12 @@ public:
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();