Bug 1329098. Part 2 - remove unnecessary checks. r=kaku
authorJW Wang <jwwang@mozilla.com>
Fri, 06 Jan 2017 15:22:52 +0800
changeset 328592 17d0086ac024660fd2a9de21eefd3261d2366a2c
parent 328591 c6bd3e871b126bbaf4319a1bb02f32ebdb03e0d8
child 328593 e675289447f5f45b59333a07cd4eefba25391670
push id85493
push userkwierso@gmail.com
push dateTue, 10 Jan 2017 00:45:12 +0000
treeherdermozilla-inbound@7822749b1b14 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskaku
bugs1329098
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1329098. Part 2 - remove unnecessary checks. r=kaku 1. mSentFirstFrameLoadedEvent is true in BufferingState. 2. mMinimizePreroll is false in BufferingState for buffering happens after playback starts and we reset mMinimizePreroll once playback starts. MozReview-Commit-ID: ABE7TvNEetD
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -2215,23 +2215,21 @@ NextFrameSeekingState::HandleVideoNotDec
 }
 
 void
 MediaDecoderStateMachine::
 BufferingState::DispatchDecodeTasksIfNeeded()
 {
   const bool needToDecodeAudio =
     mMaster->IsAudioDecoding() &&
-    ((!mMaster->mSentFirstFrameLoadedEvent && AudioQueue().GetSize() == 0) ||
-     (!mMaster->mMinimizePreroll && !mMaster->HaveEnoughDecodedAudio()));
+   !mMaster->HaveEnoughDecodedAudio();
 
   const bool needToDecodeVideo =
     mMaster->IsVideoDecoding() &&
-    ((!mMaster->mSentFirstFrameLoadedEvent && VideoQueue().GetSize() == 0) ||
-     (!mMaster->mMinimizePreroll && !mMaster->HaveEnoughDecodedVideo()));
+    !mMaster->HaveEnoughDecodedVideo();
 
   if (needToDecodeAudio) {
     mMaster->EnsureAudioDecodeTaskQueued();
   }
 
   if (needToDecodeVideo) {
     mMaster->EnsureVideoDecodeTaskQueued();
   }