Bug 1299064. Part 1 - move |SetState(nextState)| and ScheduleStateMachine() to the bottom of SeekCompleted(). r=kaku

UpdatePlaybackPositionInternal(), |mQuickBuffering = false| and |mMediaSink->Redraw| should belong to
the exit action of SEEKING. By change the order of the statements, we have a better definition/scope
for the jobs of each state.

MozReview-Commit-ID: 6WESdwaD8Ba

--HG--
extra : rebase_source : eab747abcf2cf375ed99d5800eba9c5558e1436c
This commit is contained in:
JW Wang 2016-08-30 15:04:43 +08:00
Родитель 3db57da9d3
Коммит d28e80999f
1 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

@ -2181,12 +2181,6 @@ MediaDecoderStateMachine::SeekCompleted()
FinishDecodeFirstFrame();
}
if (nextState == DECODER_STATE_DECODING) {
SetState(DECODER_STATE_DECODING);
} else {
SetState(nextState);
}
// Ensure timestamps are up to date.
UpdatePlaybackPositionInternal(newCurrentTime);
@ -2198,12 +2192,18 @@ MediaDecoderStateMachine::SeekCompleted()
// if we need to buffer after the seek.
mQuickBuffering = false;
ScheduleStateMachine();
if (video) {
mMediaSink->Redraw(mInfo.mVideo);
mOnPlaybackEvent.Notify(MediaEventType::Invalidate);
}
if (nextState == DECODER_STATE_DECODING) {
SetState(DECODER_STATE_DECODING);
} else {
SetState(nextState);
}
ScheduleStateMachine();
}
RefPtr<ShutdownPromise>