Bug 1238347 - stop prerolling when decoding starts if we are waiting for data. r=cpearce.
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1387,18 +1387,18 @@ void MediaDecoderStateMachine::StartDeco
mDecodeStartTime = TimeStamp::Now();
CheckIfDecodeComplete();
if (mState == DECODER_STATE_COMPLETED) {
return;
}
// Reset other state to pristine values before starting decode.
- mIsAudioPrerolling = !DonePrerollingAudio();
- mIsVideoPrerolling = !DonePrerollingVideo();
+ mIsAudioPrerolling = !DonePrerollingAudio() && !mAudioWaitRequest.Exists();
+ mIsVideoPrerolling = !DonePrerollingVideo() && !mVideoWaitRequest.Exists();
// Ensure that we've got tasks enqueued to decode data if we need to.
DispatchDecodeTasksIfNeeded();
ScheduleStateMachine();
}
void MediaDecoderStateMachine::PlayStateChanged()