Bug 1283370. Part 2 - remove unnecessary checks for HasVideo() for we assert it in the constructor. r=kaku draft
authorJW Wang <jwwang@mozilla.com>
Thu, 30 Jun 2016 17:34:31 +0800
changeset 384374 353083b246e62f94faf7b630f4bf00b41ef68b52
parent 384373 c7118bd9b4db3d4480d83098a51b04e44a385b59
child 384375 e3ee4f932e744a5385d8dc8251a99db3ff2c293b
push id22256
push userjwwang@mozilla.com
push dateWed, 06 Jul 2016 06:43:32 +0000
reviewerskaku
bugs1283370
milestone50.0a1
Bug 1283370. Part 2 - remove unnecessary checks for HasVideo() for we assert it in the constructor. r=kaku MozReview-Commit-ID: 5wfWmgtdgQw
dom/media/NextFrameSeekTask.cpp
--- a/dom/media/NextFrameSeekTask.cpp
+++ b/dom/media/NextFrameSeekTask.cpp
@@ -189,17 +189,17 @@ NextFrameSeekTask::Seek(const media::Tim
   SeekTaskResolveValue val = {};  // Zero-initialize data members.
   return SeekTask::SeekTaskPromise::CreateAndResolve(val, __func__);
 }
 
 bool
 NextFrameSeekTask::IsVideoDecoding() const
 {
   AssertOwnerThread();
-  return HasVideo() && !mIsVideoQueueFinished;
+  return !mIsVideoQueueFinished;
 }
 
 nsresult
 NextFrameSeekTask::EnsureVideoDecodeTaskQueued()
 {
   AssertOwnerThread();
   SAMPLE_LOG("EnsureVideoDecodeTaskQueued isDecoding=%d status=%s",
              IsVideoDecoding(), VideoRequestStatus());
@@ -254,28 +254,28 @@ NextFrameSeekTask::IsAudioSeekComplete()
 
 bool
 NextFrameSeekTask::IsVideoSeekComplete()
 {
   AssertOwnerThread();
   SAMPLE_LOG("IsVideoSeekComplete() curTarVal=%d vqFin=%d vqSz=%d",
       mSeekJob.Exists(), mIsVideoQueueFinished, !!mSeekedVideoData);
 
-  return !HasVideo() || mIsVideoQueueFinished || mSeekedVideoData;
+  return mIsVideoQueueFinished || mSeekedVideoData;
 }
 
 void
 NextFrameSeekTask::CheckIfSeekComplete()
 {
   AssertOwnerThread();
 
   const bool audioSeekComplete = IsAudioSeekComplete();
 
   const bool videoSeekComplete = IsVideoSeekComplete();
-  if (HasVideo() && !videoSeekComplete) {
+  if (!videoSeekComplete) {
     // We haven't reached the target. Ensure we have requested another sample.
     if (NS_FAILED(EnsureVideoDecodeTaskQueued())) {
       DECODER_WARN("Failed to request video during seek");
       RejectIfExist(__func__);
     }
   }
 
   SAMPLE_LOG("CheckIfSeekComplete() audioSeekComplete=%d videoSeekComplete=%d",