Bug 1330603. Part 1 - remove the call to CheckIfDecodeComplete() from HandleEndOf{Audio,Video}.
1. in HandleEndOfAudio, we surely have !IsAudioDecoding(). So we only need to check !IsVideoDecoding().
2. likewise, we only need to check !IsAudioDecoding() in HandleEndOfVideo().
MozReview-Commit-ID: A3pj1LC2okB
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -2120,29 +2120,29 @@ DecodingState::Enter()
}
}
void
MediaDecoderStateMachine::
DecodingState::HandleEndOfAudio()
{
AudioQueue().Finish();
- if (mMaster->CheckIfDecodeComplete()) {
+ if (!mMaster->IsVideoDecoding()) {
SetState<CompletedState>();
} else {
MaybeStopPrerolling();
}
}
void
MediaDecoderStateMachine::
DecodingState::HandleEndOfVideo()
{
VideoQueue().Finish();
- if (mMaster->CheckIfDecodeComplete()) {
+ if (!mMaster->IsAudioDecoding()) {
SetState<CompletedState>();
} else {
MaybeStopPrerolling();
}
}
void
MediaDecoderStateMachine::
@@ -2376,30 +2376,30 @@ BufferingState::Step()
SetState<DecodingState>();
}
void
MediaDecoderStateMachine::
BufferingState::HandleEndOfAudio()
{
AudioQueue().Finish();
- if (mMaster->CheckIfDecodeComplete()) {
+ if (!mMaster->IsVideoDecoding()) {
SetState<CompletedState>();
} else {
// Check if we can exit buffering.
mMaster->ScheduleStateMachine();
}
}
void
MediaDecoderStateMachine::
BufferingState::HandleEndOfVideo()
{
VideoQueue().Finish();
- if (mMaster->CheckIfDecodeComplete()) {
+ if (!mMaster->IsAudioDecoding()) {
SetState<CompletedState>();
} else {
// Check if we can exit buffering.
mMaster->ScheduleStateMachine();
}
}
RefPtr<ShutdownPromise>