Bug 1045591 - Fix media element's autoplay for audio-only stream. r=cpearce, a=lmandel
authorJean-Yves Avenard <jyavenard@mozilla.com>
Mon, 18 Aug 2014 18:09:19 +1000
changeset 209408 f595bdcdbd1eafcb18fcb575ef193a0461f2864d
parent 209407 3741e9a5c6ca7a480ff05c384a9913007e6f82b6
child 209409 353ade05d903624e858e51bef215887297ce5739
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce, lmandel
bugs1045591
milestone32.0
Bug 1045591 - Fix media element's autoplay for audio-only stream. r=cpearce, a=lmandel
content/media/MediaDecoderStateMachine.cpp
--- a/content/media/MediaDecoderStateMachine.cpp
+++ b/content/media/MediaDecoderStateMachine.cpp
@@ -258,17 +258,19 @@ bool MediaDecoderStateMachine::HasFuture
   AssertCurrentThreadInMonitor();
   NS_ASSERTION(HasAudio(), "Should only call HasFutureAudio() when we have audio");
   // We've got audio ready to play if:
   // 1. We've not completed playback of audio, and
   // 2. we either have more than the threshold of decoded audio available, or
   //    we've completely decoded all audio (but not finished playing it yet
   //    as per 1).
   return !mAudioCompleted &&
-         (AudioDecodedUsecs() > LOW_AUDIO_USECS * mPlaybackRate || AudioQueue().IsFinished());
+         (AudioDecodedUsecs() >
+            mLowAudioThresholdUsecs * mPlaybackRate ||
+          AudioQueue().IsFinished());
 }
 
 bool MediaDecoderStateMachine::HaveNextFrameData() {
   AssertCurrentThreadInMonitor();
   return (!HasAudio() || HasFutureAudio()) &&
          (!HasVideo() || VideoQueue().GetSize() > 0);
 }