зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1179116. Part 1 - clean up code of MediaDecoderStateMachine::MaybeStartPlayback(). r=cpearce.
This commit is contained in:
Родитель
442d53fa88
Коммит
293366faa9
|
@ -1284,17 +1284,19 @@ void MediaDecoderStateMachine::MaybeStartPlayback()
|
|||
{
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
AssertCurrentThreadInMonitor();
|
||||
MOZ_ASSERT(mState == DECODER_STATE_DECODING ||
|
||||
mState == DECODER_STATE_COMPLETED);
|
||||
|
||||
if (IsPlaying()) {
|
||||
// Logging this case is really spammy - don't do it.
|
||||
return;
|
||||
}
|
||||
|
||||
bool playStatePermits = mPlayState == MediaDecoder::PLAY_STATE_PLAYING;
|
||||
bool decodeStatePermits = mState == DECODER_STATE_DECODING || mState == DECODER_STATE_COMPLETED;
|
||||
if (!playStatePermits || !decodeStatePermits || mIsAudioPrerolling || mIsVideoPrerolling) {
|
||||
DECODER_LOG("Not starting playback [playStatePermits: %d, decodeStatePermits: %d, "
|
||||
"mIsAudioPrerolling: %d, mIsVideoPrerolling: %d]", (int) playStatePermits,
|
||||
(int) decodeStatePermits, (int) mIsAudioPrerolling, (int) mIsVideoPrerolling);
|
||||
if (!playStatePermits || mIsAudioPrerolling || mIsVideoPrerolling) {
|
||||
DECODER_LOG("Not starting playback [playStatePermits: %d, "
|
||||
"mIsAudioPrerolling: %d, mIsVideoPrerolling: %d]",
|
||||
(int) playStatePermits, (int) mIsAudioPrerolling, (int) mIsVideoPrerolling);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2605,7 +2607,6 @@ nsresult MediaDecoderStateMachine::RunStateMachine()
|
|||
|
||||
// Notify to allow blocked decoder thread to continue
|
||||
mDecoder->GetReentrantMonitor().NotifyAll();
|
||||
MaybeStartPlayback();
|
||||
NS_ASSERTION(IsStateMachineScheduled(), "Must have timer scheduled");
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче