Bug 1306186. Part 1 - remove checks for mIsAudioPrerolling and mIsVideoPrerolling from NeedToSkipToNextKeyframe().
When we reach |isLowOnDecodedAudio = ...|, mMediaSink->IsStarted() must be true which means prerolling is done
and both mIsAudioPrerolling and mIsVideoPrerolling are false.
MozReview-Commit-ID: Bt1dMw692jI
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -989,22 +989,21 @@ MediaDecoderStateMachine::NeedToSkipToNe
// audio, or if we're low on video, provided we're not running low on
// data to decode. If we're running low on downloaded data to decode,
// we won't start keyframe skipping, as we'll be pausing playback to buffer
// soon anyway and we'll want to be able to display frames immediately
// after buffering finishes. We ignore the low audio calculations for
// readers that are async, as since their audio decode runs on a different
// task queue it should never run low and skipping won't help their decode.
bool isLowOnDecodedAudio = !mReader->IsAsync() &&
- !mIsAudioPrerolling && IsAudioDecoding() &&
+ IsAudioDecoding() &&
(GetDecodedAudioDuration() <
mLowAudioThresholdUsecs * mPlaybackRate);
- bool isLowOnDecodedVideo = !mIsVideoPrerolling &&
- ((GetClock() - mDecodedVideoEndTime) * mPlaybackRate >
- LOW_VIDEO_THRESHOLD_USECS);
+ bool isLowOnDecodedVideo = (GetClock() - mDecodedVideoEndTime) * mPlaybackRate >
+ LOW_VIDEO_THRESHOLD_USECS;
bool lowBuffered = HasLowBufferedData();
if ((isLowOnDecodedAudio || isLowOnDecodedVideo) && !lowBuffered) {
DECODER_LOG("Skipping video decode to the next keyframe lowAudio=%d lowVideo=%d lowUndecoded=%d async=%d",
isLowOnDecodedAudio, isLowOnDecodedVideo, lowBuffered, mReader->IsAsync());
return true;
}