Bug 1328781. part 1 - somewhat rewrite the expression. r?kikuo
MozReview-Commit-ID: 5959ZdWKI4k
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -2501,26 +2501,19 @@ MediaDecoderStateMachine::GetDecodedAudi
}
// MediaSink not started. All audio samples are in the queue.
return AudioQueue().Duration();
}
bool MediaDecoderStateMachine::HaveEnoughDecodedAudio()
{
MOZ_ASSERT(OnTaskQueue());
-
int64_t ampleAudioUSecs = mAmpleAudioThresholdUsecs * mPlaybackRate;
- if (AudioQueue().GetSize() == 0 ||
- GetDecodedAudioDuration() < ampleAudioUSecs) {
- return false;
- }
-
- // MDSM will ensure buffering level is high enough for playback speed at 1x
- // at which the DecodedStream is playing.
- return true;
+ return AudioQueue().GetSize() > 0 &&
+ GetDecodedAudioDuration() >= ampleAudioUSecs;
}
bool MediaDecoderStateMachine::HaveEnoughDecodedVideo()
{
MOZ_ASSERT(OnTaskQueue());
if (VideoQueue().GetSize() == 0) {
return false;