Bug 1352319. P11 - change the type of NextFrameSeekingState::mCurrentTime to TimeUnit. r=kaku
authorJW Wang <jwwang@mozilla.com>
Tue, 28 Mar 2017 16:38:26 +0800
changeset 398758 83cf99ea83df3e4e8c4805c360963c9a5c940bef
parent 398757 e58dc73396a9c1cdc10373832a24255758992f4e
child 398759 5ee60477d72f85ab61d9afc8e01f1b616ad6dee6
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskaku
bugs1352319
milestone55.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 1352319. P11 - change the type of NextFrameSeekingState::mCurrentTime to TimeUnit. r=kaku MozReview-Commit-ID: Q4u92HgGdF
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1479,17 +1479,17 @@ public:
   explicit NextFrameSeekingState(Master* aPtr) : SeekingState(aPtr)
   {
   }
 
   RefPtr<MediaDecoder::SeekPromise> Enter(SeekJob&& aSeekJob,
                                           EventVisibility aVisibility)
   {
     MOZ_ASSERT(aSeekJob.mTarget->IsNextFrame());
-    mCurrentTime = mMaster->GetMediaTime().ToMicroseconds();
+    mCurrentTime = mMaster->GetMediaTime();
     mDuration = mMaster->Duration();
     return SeekingState::Enter(Move(aSeekJob), aVisibility);
   }
 
   void Exit() override
   {
     // Disconnect my async seek operation.
     mAsyncSeekTask->Cancel();
@@ -1498,17 +1498,17 @@ public:
     mSeekJob.RejectIfExists(__func__);
   }
 
 private:
   void DoSeekInternal()
   {
     auto currentTime = mCurrentTime;
     DiscardFrames(VideoQueue(), [currentTime] (int64_t aSampleTime) {
-      return aSampleTime <= currentTime;
+      return aSampleTime <= currentTime.ToMicroseconds();
     });
 
     if (!NeedMoreVideo()) {
       FinishSeek();
     } else if (!mMaster->IsRequestingVideoData()
                && !mMaster->IsWaitingVideoData()) {
       RequestVideoData();
     }
@@ -1559,17 +1559,17 @@ private:
   }
 
   void HandleVideoDecoded(VideoData* aVideo, TimeStamp aDecodeStart) override
   {
     MOZ_ASSERT(aVideo);
     MOZ_ASSERT(!mSeekJob.mPromise.IsEmpty(), "Seek shouldn't be finished");
     MOZ_ASSERT(NeedMoreVideo());
 
-    if (aVideo->mTime > mCurrentTime) {
+    if (aVideo->mTime > mCurrentTime.ToMicroseconds()) {
       mMaster->PushVideo(aVideo);
       FinishSeek();
     } else {
       RequestVideoData();
     }
   }
 
   void HandleWaitingForAudio() override
@@ -1672,18 +1672,18 @@ private:
       return aSampleTime < time;
     });
     SeekCompleted();
   }
 
   /*
    * Internal state.
    */
-  int64_t mCurrentTime;
-  media::TimeUnit mDuration;
+  TimeUnit mCurrentTime;
+  TimeUnit mDuration;
   RefPtr<AysncNextFrameSeekTask> mAsyncSeekTask;
 };
 
 /**
  * Purpose: stop playback until enough data is decoded to continue playback.
  *
  * Transition to:
  *   SEEKING if any seek request.