Bug 1328547. part 3 - inline NeedToDecode{Audio,Video} and remove some checks. r?kaku
1. |mState != DECODER_STATE_SEEKING| is true in DecodingState.
2. mSentFirstFrameLoadedEvent is true in DecodingState.
3. mMinimizePreroll is false because pop events fire only after MDSM starts playing.
MozReview-Commit-ID: FTkXmtEnzY5
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1993,23 +1993,23 @@ DecodingState::Enter()
if (mMaster->CheckIfDecodeComplete()) {
SetState<CompletedState>();
return;
}
mOnAudioPopped = AudioQueue().PopEvent().Connect(
OwnerThread(), [this] () {
- if (mMaster->NeedToDecodeAudio()) {
+ if (mMaster->IsAudioDecoding() && !mMaster->HaveEnoughDecodedAudio()) {
mMaster->EnsureAudioDecodeTaskQueued();
}
});
mOnVideoPopped = VideoQueue().PopEvent().Connect(
OwnerThread(), [this] () {
- if (mMaster->NeedToDecodeVideo()) {
+ if (mMaster->IsVideoDecoding() && !mMaster->HaveEnoughDecodedVideo()) {
mMaster->EnsureVideoDecodeTaskQueued();
}
});
mMaster->UpdateNextFrameStatus(MediaDecoderOwner::NEXT_FRAME_AVAILABLE);
mDecodeStartTime = TimeStamp::Now();