From 0510a532cdc6094dc6ed7769ee9c9a221ec8a123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Velad=20Galv=C3=A1n?= Date: Wed, 8 Jan 2025 11:28:00 +0100 Subject: [PATCH] fix(HLS): Omit daterange without START-DATE in order to avoid errors (#7841) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per the HLS spec, we require a START-DATE for SCTE35-IN However, unlike for SCTE35-OUT and SCTE35-CMD, it’s not clear what that value should be – and the HLS spec example does not include it. --- lib/hls/hls_parser.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/hls/hls_parser.js b/lib/hls/hls_parser.js index 7ff3193605..69d0b1dcbf 100644 --- a/lib/hls/hls_parser.js +++ b/lib/hls/hls_parser.js @@ -3987,7 +3987,9 @@ shaka.hls.HlsParser = class { } let dateRangeTags = shaka.hls.Utils.filterTagsByName(tags, 'EXT-X-DATERANGE'); - dateRangeTags = dateRangeTags.sort((a, b) => { + dateRangeTags = dateRangeTags.filter((tag) => { + return tag.getAttribute('START-DATE') != null; + }).sort((a, b) => { const aStartDateValue = a.getRequiredAttrValue('START-DATE'); const bStartDateValue = b.getRequiredAttrValue('START-DATE'); if (aStartDateValue < bStartDateValue) {