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 208324 f595bdcdbd1e
parent 208323 3741e9a5c6ca
child 208325 353ade05d903
push id3824
push userryanvm@gmail.com
push date2014-08-18 16:06 +0000
treeherdermozilla-beta@f595bdcdbd1e [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);
 }