Bug 1330603. Part 2 - remove MDSM::CheckIfDecodeComplete().
MozReview-Commit-ID: 1bkWVknX2FO
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -2080,17 +2080,17 @@ DecodingState::Enter()
if (!mMaster->mIsVisible &&
!mMaster->mVideoDecodeSuspendTimer.IsScheduled() &&
!mMaster->mVideoDecodeSuspended) {
// If we are not visible and the timer is not schedule, it means the timer
// has timed out and we should suspend video decoding now if necessary.
HandleVideoSuspendTimeout();
}
- if (mMaster->CheckIfDecodeComplete()) {
+ if (!mMaster->IsVideoDecoding() && !mMaster->IsAudioDecoding()) {
SetState<CompletedState>();
return;
}
mOnAudioPopped = AudioQueue().PopEvent().Connect(
OwnerThread(), [this] () {
if (mMaster->IsAudioDecoding() && !mMaster->HaveEnoughDecodedAudio()) {
EnsureAudioDecodeTaskQueued();
@@ -2693,27 +2693,16 @@ MediaDecoderStateMachine::IsAudioDecodin
bool
MediaDecoderStateMachine::IsVideoDecoding()
{
MOZ_ASSERT(OnTaskQueue());
return HasVideo() && !VideoQueue().IsFinished();
}
-bool
-MediaDecoderStateMachine::CheckIfDecodeComplete()
-{
- MOZ_ASSERT(OnTaskQueue());
- // DecodeComplete is possible only after decoding first frames.
- MOZ_ASSERT(mSentFirstFrameLoadedEvent);
- MOZ_ASSERT(mState == DECODER_STATE_DECODING ||
- mState == DECODER_STATE_BUFFERING);
- return !IsVideoDecoding() && !IsAudioDecoding();
-}
-
bool MediaDecoderStateMachine::IsPlaying() const
{
MOZ_ASSERT(OnTaskQueue());
return mMediaSink->IsPlaying();
}
nsresult MediaDecoderStateMachine::Init(MediaDecoder* aDecoder)
{
--- a/dom/media/MediaDecoderStateMachine.h
+++ b/dom/media/MediaDecoderStateMachine.h
@@ -438,19 +438,16 @@ protected:
// which has been pushed to the audio hardware for playback. Note that after
// calling this, the audio hardware may play some of the audio pushed to
// hardware, so this can only be used as a upper bound. The decoder monitor
// must be held when calling this. Called on the decode thread.
int64_t GetDecodedAudioDuration();
void FinishDecodeFirstFrame();
- // Queries our state to see whether the decode has finished for all streams.
- bool CheckIfDecodeComplete();
-
// Performs one "cycle" of the state machine.
void RunStateMachine();
bool IsStateMachineScheduled() const;
// These return true if the respective stream's decode has not yet reached
// the end of stream.
bool IsAudioDecoding();