From ed7ab7698d6686747f3a2007dffdf3ad01da848d Mon Sep 17 00:00:00 2001 From: Alvaro Velad Galvan Date: Thu, 15 Jun 2023 14:43:07 +0200 Subject: [PATCH 1/3] feat(HLS): Mark first partial segment as independent always --- lib/hls/hls_parser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/hls/hls_parser.js b/lib/hls/hls_parser.js index c8e26ce720..367a66de69 100644 --- a/lib/hls/hls_parser.js +++ b/lib/hls/hls_parser.js @@ -2915,7 +2915,7 @@ shaka.hls.HlsParser = class { if (item.name == 'EXT-X-PRELOAD-HINT') { partial.markAsPreload(); } - if (item.getAttributeValue('INDEPENDENT') != 'YES') { + if (item.getAttributeValue('INDEPENDENT') != 'YES' && i > 0) { partial.markAsNonIndependent(); } partialSegmentRefs.push(partial); From 2970c88322ca3f6b9fa94fe4c02165fb5f8f7358 Mon Sep 17 00:00:00 2001 From: Alvaro Velad Galvan Date: Sat, 17 Jun 2023 18:22:49 +0200 Subject: [PATCH 2/3] Add comment --- lib/hls/hls_parser.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/hls/hls_parser.js b/lib/hls/hls_parser.js index 367a66de69..a20e94b459 100644 --- a/lib/hls/hls_parser.js +++ b/lib/hls/hls_parser.js @@ -2915,6 +2915,10 @@ shaka.hls.HlsParser = class { if (item.name == 'EXT-X-PRELOAD-HINT') { partial.markAsPreload(); } + // The spec doesn't say we can assume INDEPENDENT=YES for the first + // partial segment. It does call the flag "optional", though, and that + // cases where there are no such flags on any partial segments, it is + // sensible to assume the first one is independent. if (item.getAttributeValue('INDEPENDENT') != 'YES' && i > 0) { partial.markAsNonIndependent(); } From d29fa6dc5b36e2853cf10c30a0ca314559ddbd0f Mon Sep 17 00:00:00 2001 From: Alvaro Velad Galvan Date: Sat, 17 Jun 2023 18:24:20 +0200 Subject: [PATCH 3/3] Fix comment --- lib/hls/hls_parser.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/hls/hls_parser.js b/lib/hls/hls_parser.js index a20e94b459..e0037d7844 100644 --- a/lib/hls/hls_parser.js +++ b/lib/hls/hls_parser.js @@ -2915,10 +2915,10 @@ shaka.hls.HlsParser = class { if (item.name == 'EXT-X-PRELOAD-HINT') { partial.markAsPreload(); } - // The spec doesn't say we can assume INDEPENDENT=YES for the first - // partial segment. It does call the flag "optional", though, and that - // cases where there are no such flags on any partial segments, it is - // sensible to assume the first one is independent. + // The spec doesn't say that we can assume INDEPENDENT=YES for the + // first partial segment. It does call the flag "optional", though, and + // that cases where there are no such flags on any partial segments, it + // is sensible to assume the first one is independent. if (item.getAttributeValue('INDEPENDENT') != 'YES' && i > 0) { partial.markAsNonIndependent(); }