diff --git a/dom/media/MediaFormatReader.cpp b/dom/media/MediaFormatReader.cpp index 55a5d1f8fa7c..e25533e2eb03 100644 --- a/dom/media/MediaFormatReader.cpp +++ b/dom/media/MediaFormatReader.cpp @@ -520,10 +520,7 @@ MediaFormatReader::RequestVideoData(bool aSkipToNextKeyframe, } media::TimeUnit timeThreshold{media::TimeUnit::FromMicroseconds(aTimeThreshold)}; - // Ensure we have no pending seek going as ShouldSkip could return out of date - // information. - if (!mVideo.HasInternalSeekPending() && - ShouldSkip(aSkipToNextKeyframe, timeThreshold)) { + if (ShouldSkip(aSkipToNextKeyframe, timeThreshold)) { // Cancel any pending demux request. mVideo.mDemuxRequest.DisconnectIfExists(); @@ -1001,9 +998,6 @@ void MediaFormatReader::InternalSeek(TrackType aTrack, const InternalSeekTarget& aTarget) { MOZ_ASSERT(OnTaskQueue()); - LOG("%s internal seek to %f", - TrackTypeToStr(aTrack), aTarget.mTime.ToSeconds()); - auto& decoder = GetDecoderData(aTrack); decoder.mTimeThreshold = Some(aTarget); RefPtr self = this; @@ -1281,6 +1275,8 @@ MediaFormatReader::ResetDecode() MOZ_ASSERT(OnTaskQueue()); LOGV(""); + mAudio.mSeekRequest.DisconnectIfExists(); + mVideo.mSeekRequest.DisconnectIfExists(); mSeekPromise.RejectIfExists(NS_OK, __func__); mSkipRequest.DisconnectIfExists(); diff --git a/dom/media/MediaFormatReader.h b/dom/media/MediaFormatReader.h index d03a04c2cd44..0bcbc7acfca1 100644 --- a/dom/media/MediaFormatReader.h +++ b/dom/media/MediaFormatReader.h @@ -330,7 +330,6 @@ private: { // Clear demuxer related data. mDemuxRequest.DisconnectIfExists(); - mSeekRequest.DisconnectIfExists(); mTrackDemuxer->Reset(); } @@ -357,11 +356,6 @@ private: mNextStreamSourceID.reset(); } - bool HasInternalSeekPending() const - { - return mTimeThreshold && !mTimeThreshold.ref().mHasSeeked; - } - // Used by the MDSM for logging purposes. Atomic mSizeOfQueue; // Used by the MDSM to determine if video decoding is hardware accelerated.