From 7f8e051886e6aab1b7a1997a600f982ca38c0c6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Velad=20Galv=C3=A1n?= Date: Thu, 29 Jun 2023 11:46:51 +0200 Subject: [PATCH] fix(HLS): Fix avoid prefetch missing segments (#5372) --- 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_);