Bug 1328781. part 1 - somewhat rewrite the expression. r?kikuo draft
authorJW Wang <jwwang@mozilla.com>
Wed, 04 Jan 2017 17:35:04 +0800
changeset 456127 2cac1779a77dd3e36c980300b6e5beb21c2ccc94
parent 456113 6f1fc91c5e6f34a7acca338aa09ed785a6a8035b
child 456128 60f6f6dbed9d8f12782c63b5f4e96abc2915ee73
push id40416
push userjwwang@mozilla.com
push dateThu, 05 Jan 2017 04:11:00 +0000
reviewerskikuo
bugs1328781
milestone53.0a1
Bug 1328781. part 1 - somewhat rewrite the expression. r?kikuo MozReview-Commit-ID: 5959ZdWKI4k
dom/media/MediaDecoderStateMachine.cpp
--- 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;