Bug 889233 - Fix transition from dormant to other state. r=doublec

This commit is contained in:
Sotaro Ikeda 2013-07-07 16:33:57 -04:00
parent 4fb77bcb31
commit 7eb627a7fa

View File

@ -727,6 +727,9 @@ void MediaDecoder::MetadataLoaded(int aChannels, int aRate, bool aHasAudio, bool
{
ReentrantMonitorAutoEnter mon(GetReentrantMonitor());
if (mPlayState == PLAY_STATE_LOADING && mIsDormant) {
mIsDormant = false;
}
mDuration = mDecoderStateMachine ? mDecoderStateMachine->GetDuration() : -1;
// Duration has changed so we should recompute playback rate
UpdatePlaybackRate();
@ -1144,7 +1147,8 @@ void MediaDecoder::ChangeState(PlayState aState)
mNextState = PLAY_STATE_PAUSED;
}
if ((mPlayState == PLAY_STATE_LOADING && mIsDormant) || mPlayState == PLAY_STATE_SHUTDOWN) {
if ((mPlayState == PLAY_STATE_LOADING && mIsDormant && aState != PLAY_STATE_SHUTDOWN) ||
mPlayState == PLAY_STATE_SHUTDOWN) {
GetReentrantMonitor().NotifyAll();
return;
}