Bug 1349097 P3 - don't dispatch another ended event while resuming the video decoder of an already-ended playback; r=jwwang

If the play state is already PLAY_STATE_ENDED, make MediaDecoder::PlaybackEnded() return early to prevent dispatching multiple ended event.

MozReview-Commit-ID: G5OU7WLYuMm

--HG--
extra : rebase_source : 17c8e355f59950166b112eaf2629f82b357fb60b
This commit is contained in:
Kaku Kuo 2017-04-05 22:57:25 +08:00
parent 944f44bf4d
commit d894ae1293

View File

@ -992,7 +992,8 @@ MediaDecoder::PlaybackEnded()
MOZ_ASSERT(NS_IsMainThread());
MOZ_DIAGNOSTIC_ASSERT(!IsShutdown());
if (mLogicallySeeking || mPlayState == PLAY_STATE_LOADING) {
if (mLogicallySeeking || mPlayState == PLAY_STATE_LOADING ||
mPlayState == PLAY_STATE_ENDED) {
LOG("MediaDecoder::PlaybackEnded bailed out, "
"mLogicallySeeking=%d mPlayState=%s",
mLogicallySeeking.Ref(), ToPlayStateStr(mPlayState));