зеркало из https://github.com/mozilla/gecko-dev.git
Bug 713381 - Add null check on decoder state machine. r=roc
This commit is contained in:
Родитель
156afc9357
Коммит
9b446a7ca7
|
@ -245,6 +245,7 @@ nsresult nsBuiltinDecoder::ScheduleStateMachineThread()
|
|||
NS_ASSERTION(NS_IsMainThread(), "Should be on main thread.");
|
||||
NS_ASSERTION(mDecoderStateMachine,
|
||||
"Must have state machine to start state machine thread");
|
||||
NS_ENSURE_STATE(mDecoderStateMachine);
|
||||
|
||||
if (mShuttingDown)
|
||||
return NS_OK;
|
||||
|
@ -832,29 +833,19 @@ void nsBuiltinDecoder::ChangeState(PlayState aState)
|
|||
}
|
||||
|
||||
mPlayState = aState;
|
||||
switch (aState) {
|
||||
case PLAY_STATE_PAUSED:
|
||||
/* No action needed */
|
||||
break;
|
||||
case PLAY_STATE_PLAYING:
|
||||
mDecoderStateMachine->Play();
|
||||
break;
|
||||
case PLAY_STATE_SEEKING:
|
||||
mDecoderStateMachine->Seek(mRequestedSeekTime);
|
||||
mRequestedSeekTime = -1.0;
|
||||
break;
|
||||
case PLAY_STATE_LOADING:
|
||||
/* No action needed */
|
||||
break;
|
||||
case PLAY_STATE_START:
|
||||
/* No action needed */
|
||||
break;
|
||||
case PLAY_STATE_ENDED:
|
||||
/* No action needed */
|
||||
break;
|
||||
case PLAY_STATE_SHUTDOWN:
|
||||
/* No action needed */
|
||||
break;
|
||||
if (mDecoderStateMachine) {
|
||||
switch (aState) {
|
||||
case PLAY_STATE_PLAYING:
|
||||
mDecoderStateMachine->Play();
|
||||
break;
|
||||
case PLAY_STATE_SEEKING:
|
||||
mDecoderStateMachine->Seek(mRequestedSeekTime);
|
||||
mRequestedSeekTime = -1.0;
|
||||
break;
|
||||
default:
|
||||
/* No action needed */
|
||||
break;
|
||||
}
|
||||
}
|
||||
mReentrantMonitor.NotifyAll();
|
||||
}
|
||||
|
@ -973,7 +964,9 @@ void nsBuiltinDecoder::Resume(bool aForceBuffering)
|
|||
}
|
||||
if (aForceBuffering) {
|
||||
ReentrantMonitorAutoEnter mon(mReentrantMonitor);
|
||||
mDecoderStateMachine->StartBuffering();
|
||||
if (mDecoderStateMachine) {
|
||||
mDecoderStateMachine->StartBuffering();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче