Bug 1329098. Part 2 - remove unnecessary checks.
1. mSentFirstFrameLoadedEvent is true in BufferingState.
2. mMinimizePreroll is false in BufferingState for buffering happens after playback starts and we reset mMinimizePreroll once playback starts.
MozReview-Commit-ID: ABE7TvNEetD
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -2215,23 +2215,21 @@ NextFrameSeekingState::HandleVideoNotDec
}
void
MediaDecoderStateMachine::
BufferingState::DispatchDecodeTasksIfNeeded()
{
const bool needToDecodeAudio =
mMaster->IsAudioDecoding() &&
- ((!mMaster->mSentFirstFrameLoadedEvent && AudioQueue().GetSize() == 0) ||
- (!mMaster->mMinimizePreroll && !mMaster->HaveEnoughDecodedAudio()));
+ !mMaster->HaveEnoughDecodedAudio();
const bool needToDecodeVideo =
mMaster->IsVideoDecoding() &&
- ((!mMaster->mSentFirstFrameLoadedEvent && VideoQueue().GetSize() == 0) ||
- (!mMaster->mMinimizePreroll && !mMaster->HaveEnoughDecodedVideo()));
+ !mMaster->HaveEnoughDecodedVideo();
if (needToDecodeAudio) {
mMaster->EnsureAudioDecodeTaskQueued();
}
if (needToDecodeVideo) {
mMaster->EnsureVideoDecodeTaskQueued();
}