Bug 1322800 part 2 - move NextFrameSeekTask::CalculateNewCurrentTime(); r?jwwang
MozReview-Commit-ID: 8plgauwNBme
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1399,17 +1399,19 @@ private:
if (!mTask->IsVideoRequestPending() && mTask->NeedMoreVideo()) {
mTask->RequestVideoData();
}
mTask->MaybeFinishSeek(); // Might resolve mSeekTaskPromise and modify audio queue.
}
int64_t CalculateNewCurrentTime() const override
{
- return mSeekTask->CalculateNewCurrentTime();
+ // The HTMLMediaElement.currentTime should be updated to the seek target
+ // which has been updated to the next frame's time.
+ return mTask->mTarget.GetTime().ToMicroseconds();
}
void OnSeekTaskResolved(const SeekTaskResolveValue& aValue)
{
mSeekTaskRequest.Complete();
if (aValue.mSeekedAudioData) {
mMaster->Push(aValue.mSeekedAudioData);
--- a/dom/media/NextFrameSeekTask.cpp
+++ b/dom/media/NextFrameSeekTask.cpp
@@ -54,20 +54,17 @@ NextFrameSeekTask::Discard()
mIsDiscarded = true;
}
int64_t
NextFrameSeekTask::CalculateNewCurrentTime() const
{
AssertOwnerThread();
-
- // The HTMLMediaElement.currentTime should be updated to the seek target
- // which has been updated to the next frame's time.
- return mTarget.GetTime().ToMicroseconds();
+ return 0;
}
void
NextFrameSeekTask::HandleAudioDecoded(MediaData* aAudio)
{
AssertOwnerThread();
MOZ_ASSERT(aAudio);
MOZ_ASSERT(!mSeekTaskPromise.IsEmpty(), "Seek shouldn't be finished");