diff --git a/dom/media/MediaDecoderStateMachine.cpp b/dom/media/MediaDecoderStateMachine.cpp index 348c793d864c..05128b045680 100644 --- a/dom/media/MediaDecoderStateMachine.cpp +++ b/dom/media/MediaDecoderStateMachine.cpp @@ -460,12 +460,13 @@ void MediaDecoderStateMachine::DiscardStreamData() } } -bool MediaDecoderStateMachine::HaveEnoughDecodedAudio(int64_t aAmpleAudioUSecs) +bool MediaDecoderStateMachine::HaveEnoughDecodedAudio() { MOZ_ASSERT(OnTaskQueue()); + int64_t ampleAudioUSecs = mAmpleAudioThresholdUsecs * mPlaybackRate; if (AudioQueue().GetSize() == 0 || - GetDecodedAudioDuration() < aAmpleAudioUSecs) { + GetDecodedAudioDuration() < ampleAudioUSecs) { return false; } @@ -562,14 +563,12 @@ MediaDecoderStateMachine::NeedToDecodeAudio() { MOZ_ASSERT(OnTaskQueue()); SAMPLE_LOG("NeedToDecodeAudio() isDec=%d minPrl=%d enufAud=%d", - IsAudioDecoding(), mMinimizePreroll, - HaveEnoughDecodedAudio(mAmpleAudioThresholdUsecs * mPlaybackRate)); + IsAudioDecoding(), mMinimizePreroll, HaveEnoughDecodedAudio()); return IsAudioDecoding() && mState != DECODER_STATE_SEEKING && ((IsDecodingFirstFrame() && AudioQueue().GetSize() == 0) || - (!mMinimizePreroll && - !HaveEnoughDecodedAudio(mAmpleAudioThresholdUsecs * mPlaybackRate))); + (!mMinimizePreroll && !HaveEnoughDecodedAudio())); } bool diff --git a/dom/media/MediaDecoderStateMachine.h b/dom/media/MediaDecoderStateMachine.h index 3d6d240b3289..ef8f22bb3cf0 100644 --- a/dom/media/MediaDecoderStateMachine.h +++ b/dom/media/MediaDecoderStateMachine.h @@ -340,7 +340,7 @@ private: // Discard audio/video data that are already played by MSG. void DiscardStreamData(); - bool HaveEnoughDecodedAudio(int64_t aAmpleAudioUSecs); + bool HaveEnoughDecodedAudio(); bool HaveEnoughDecodedVideo(); // Returns true if the state machine has shutdown or is in the process of