Bug 1329098. Part 5 - remove unnecessary checks and temps. r=kaku
authorJW Wang <jwwang@mozilla.com>
Fri, 06 Jan 2017 15:49:02 +0800
changeset 328528 c00b89907a83d023448bffe7ad48e65dbc2a900a
parent 328527 8f579fb33b2574df84cd832d96fffa9cdfa2a80e
child 328529 3b46fcc012e52d208c9a9381d56e7d566915117c
push id31178
push userkwierso@gmail.com
push dateTue, 10 Jan 2017 00:30:08 +0000
treeherdermozilla-central@6bcc24319ba5 [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 5 - remove unnecessary checks and temps. r=kaku For mSentFirstFrameLoadedEvent is true in DecodingState. MozReview-Commit-ID: 8zpsMAME8p6
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -2041,31 +2041,25 @@ DecodingState::HandleEndOfStream()
     MaybeStopPrerolling();
   }
 }
 
 void
 MediaDecoderStateMachine::
 DecodingState::DispatchDecodeTasksIfNeeded()
 {
-  const bool needToDecodeAudio =
-    mMaster->IsAudioDecoding() &&
-    ((!mMaster->mSentFirstFrameLoadedEvent && AudioQueue().GetSize() == 0) ||
-     (!mMaster->mMinimizePreroll && !mMaster->HaveEnoughDecodedAudio()));
-
-  const bool needToDecodeVideo =
-    mMaster->IsVideoDecoding() &&
-    ((!mMaster->mSentFirstFrameLoadedEvent && VideoQueue().GetSize() == 0) ||
-     (!mMaster->mMinimizePreroll && !mMaster->HaveEnoughDecodedVideo()));
-
-  if (needToDecodeAudio) {
+  if (mMaster->IsAudioDecoding() &&
+      !mMaster->mMinimizePreroll &&
+      !mMaster->HaveEnoughDecodedAudio()) {
     mMaster->EnsureAudioDecodeTaskQueued();
   }
 
-  if (needToDecodeVideo) {
+  if (mMaster->IsVideoDecoding() &&
+      !mMaster->mMinimizePreroll &&
+      !mMaster->HaveEnoughDecodedVideo()) {
     mMaster->EnsureVideoDecodeTaskQueued();
   }
 }
 
 void
 MediaDecoderStateMachine::
 DecodingState::MaybeStartBuffering()
 {