diff --git a/dom/media/MediaFormatReader.cpp b/dom/media/MediaFormatReader.cpp index 2016b5ff70f6..6702f066c861 100644 --- a/dom/media/MediaFormatReader.cpp +++ b/dom/media/MediaFormatReader.cpp @@ -1447,6 +1447,15 @@ MediaFormatReader::OnVideoSkipFailed(MediaTrackDemuxer::SkipFailureHolder aFailu NotifyEndOfStream(TrackType::kVideoTrack); break; case DemuxerFailureReason::WAITING_FOR_DATA: + // While there is nothing to drain considering the decoder has been + // flushed in SkipVideoDemuxToNextKeyFrame, we need to set mNeedDraining + // to true as the video MediaDataPromise will only be rejected once drain + // has completed. + MOZ_DIAGNOSTIC_ASSERT(!mVideo.mDecodingRequested, + "Reset must have been called"); + if (!mVideo.mWaitingForData) { + mVideo.mNeedDraining = true; + } NotifyWaitingForData(TrackType::kVideoTrack); break; case DemuxerFailureReason::CANCELED: