diff options
Diffstat (limited to 'dom/media/MediaFormatReader.cpp')
-rw-r--r-- | dom/media/MediaFormatReader.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/dom/media/MediaFormatReader.cpp b/dom/media/MediaFormatReader.cpp index e6dbf27ce..3dadf051e 100644 --- a/dom/media/MediaFormatReader.cpp +++ b/dom/media/MediaFormatReader.cpp @@ -478,7 +478,8 @@ MediaFormatReader::RequestVideoData(bool aSkipToNextKeyframe, MOZ_ASSERT(OnTaskQueue()); MOZ_DIAGNOSTIC_ASSERT(mSeekPromise.IsEmpty(), "No sample requests allowed while seeking"); MOZ_DIAGNOSTIC_ASSERT(!mVideo.HasPromise(), "No duplicate sample requests"); - MOZ_DIAGNOSTIC_ASSERT(!mVideo.mSeekRequest.Exists()); + MOZ_DIAGNOSTIC_ASSERT(!mVideo.mSeekRequest.Exists() || + mVideo.mTimeThreshold.isSome()); MOZ_DIAGNOSTIC_ASSERT(!mSkipRequest.Exists(), "called mid-skipping"); MOZ_DIAGNOSTIC_ASSERT(!IsSeeking(), "called mid-seek"); LOGV("RequestVideoData(%d, %lld)", aSkipToNextKeyframe, aTimeThreshold); @@ -574,7 +575,8 @@ MediaFormatReader::RequestAudioData() { MOZ_ASSERT(OnTaskQueue()); MOZ_DIAGNOSTIC_ASSERT(mSeekPromise.IsEmpty(), "No sample requests allowed while seeking"); - MOZ_DIAGNOSTIC_ASSERT(!mAudio.mSeekRequest.Exists()); + MOZ_DIAGNOSTIC_ASSERT(!mAudio.mSeekRequest.Exists() || + mAudio.mTimeThreshold.isSome()); MOZ_DIAGNOSTIC_ASSERT(!mAudio.HasPromise(), "No duplicate sample requests"); MOZ_DIAGNOSTIC_ASSERT(!IsSeeking(), "called mid-seek"); LOGV(""); @@ -700,6 +702,7 @@ MediaFormatReader::NeedInput(DecoderData& aDecoder) // run of input than we input, decoders fire an "input exhausted" callback, // which overrides our "few more samples" threshold. return + !aDecoder.mDraining && !aDecoder.mError && aDecoder.HasPromise() && !aDecoder.mDemuxRequest.Exists() && @@ -908,12 +911,13 @@ MediaFormatReader::DrainDecoder(TrackType aTrack) MOZ_ASSERT(OnTaskQueue()); auto& decoder = GetDecoderData(aTrack); - if (!decoder.mNeedDraining) { + if (!decoder.mNeedDraining || decoder.mDraining) { return; } decoder.mOutputRequested = true; decoder.mDecoder->Drain(); decoder.mNeedDraining = false; + decoder.mDraining = true; LOG("Requesting %s decoder to drain", TrackTypeToStr(aTrack)); } @@ -971,6 +975,7 @@ MediaFormatReader::Update(TrackType aTrack) } } else if (decoder.mDrainComplete) { decoder.mDrainComplete = false; + decoder.mDraining = false; if (decoder.mError) { LOG("Decoding Error"); decoder.RejectPromise(DECODE_ERROR, __func__); |