From 4bbb9f5bede2b493eb6014db4f1890147c978e51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Velad=20Galv=C3=A1n?= Date: Thu, 24 Oct 2024 09:30:09 +0200 Subject: [PATCH] fix(MSS): Don't allow prefetch segments with self-generated data (#7485) --- lib/media/segment_prefetch.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/media/segment_prefetch.js b/lib/media/segment_prefetch.js index 31c0d0a3c8..03ec5a8f33 100644 --- a/lib/media/segment_prefetch.js +++ b/lib/media/segment_prefetch.js @@ -111,6 +111,9 @@ shaka.media.SegmentPrefetch = class { shaka.media.SegmentReference.Status.MISSING) { prefetchAllowed = false; } + if (reference.getSegmentData()) { + prefetchAllowed = false; + } if (prefetchAllowed && reference.initSegmentReference) { this.prefetchInitSegment(reference.initSegmentReference); } @@ -139,6 +142,10 @@ shaka.media.SegmentPrefetch = class { return; } + if (initSegmentReference.getSegmentData()) { + return; + } + // init segments are ignored from the prefetch limit const initSegments = Array.from(this.initSegmentPrefetchMap_.keys()); const someReference = initSegments.some((reference) => {