From 08b2c3900eaf2caaf99a52e259e28d5517046e38 Mon Sep 17 00:00:00 2001 From: Kaku Kuo Date: Fri, 9 Dec 2016 13:25:08 -1000 Subject: [PATCH] Bug 1322799 part 8 - move AccurateSeekTask::MaybeFinishSeek(); r=jwwang MozReview-Commit-ID: HGcK5zUxyge --HG-- extra : rebase_source : a01d897fd07aaaf339627a8bc8c1751dcedac68d --- dom/media/AccurateSeekTask.cpp | 9 --------- dom/media/AccurateSeekTask.h | 2 -- dom/media/MediaDecoderStateMachine.cpp | 13 ++++++++++--- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/dom/media/AccurateSeekTask.cpp b/dom/media/AccurateSeekTask.cpp index 18739a71df75..67a642d1c621 100644 --- a/dom/media/AccurateSeekTask.cpp +++ b/dom/media/AccurateSeekTask.cpp @@ -132,13 +132,4 @@ AccurateSeekTask::Seek(const media::TimeUnit& aDuration) return mSeekTaskPromise.Ensure(__func__); } -void -AccurateSeekTask::MaybeFinishSeek() -{ - AssertOwnerThread(); - if (mDoneAudioSeeking && mDoneVideoSeeking) { - Resolve(__func__); // Call to MDSM::SeekCompleted(); - } -} - } // namespace mozilla diff --git a/dom/media/AccurateSeekTask.h b/dom/media/AccurateSeekTask.h index d7917e45a65f..a1b16e522a32 100644 --- a/dom/media/AccurateSeekTask.h +++ b/dom/media/AccurateSeekTask.h @@ -43,8 +43,6 @@ public: ~AccurateSeekTask(); - void MaybeFinishSeek(); - /* * Internal state. */ diff --git a/dom/media/MediaDecoderStateMachine.cpp b/dom/media/MediaDecoderStateMachine.cpp index fe46c6e40913..9e83bea0f8d5 100644 --- a/dom/media/MediaDecoderStateMachine.cpp +++ b/dom/media/MediaDecoderStateMachine.cpp @@ -928,7 +928,7 @@ public: RequestAudioData(); return; } - mTask->MaybeFinishSeek(); + MaybeFinishSeek(); } void HandleVideoDecoded(MediaData* aVideo, TimeStamp aDecodeStart) override @@ -961,7 +961,7 @@ public: RequestVideoData(); return; } - mTask->MaybeFinishSeek(); + MaybeFinishSeek(); } void HandleNotDecoded(MediaData::Type aType, const MediaResult& aError) override @@ -1004,7 +1004,7 @@ public: mTask->mSeekedVideoData = mTask->mFirstVideoFrameAfterSeek.forget(); } } - mTask->MaybeFinishSeek(); + MaybeFinishSeek(); return; } @@ -1245,6 +1245,13 @@ private: return NS_OK; } + void MaybeFinishSeek() + { + if (mTask->mDoneAudioSeeking && mTask->mDoneVideoSeeking) { + mTask->Resolve(__func__); // Call to MDSM::SeekCompleted(); + } + } + void OnSeekTaskResolved(const SeekTaskResolveValue& aValue) { mSeekTaskRequest.Complete();