From 905926c890a1e7887827d2d06ab41fadbf28ed26 Mon Sep 17 00:00:00 2001 From: Alvaro Velad Galvan Date: Thu, 29 Jun 2023 10:48:20 +0200 Subject: [PATCH] fix(HLS): Fix avoid prefetch missing segments --- lib/media/segment_prefetch.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/media/segment_prefetch.js b/lib/media/segment_prefetch.js index 573bb5b3f6..0b919772b0 100644 --- a/lib/media/segment_prefetch.js +++ b/lib/media/segment_prefetch.js @@ -73,6 +73,10 @@ shaka.media.SegmentPrefetch = class { if (reference.isPreload() && reference.endByte != null) { prefetchAllowed = false; } + if (reference.getStatus() == + shaka.media.SegmentReference.Status.MISSING) { + prefetchAllowed = false; + } if (prefetchAllowed && !this.segmentPrefetchMap_.has(reference)) { const segmentPrefetchOperation = new shaka.media.SegmentPrefetchOperation(this.fetchDispatcher_);