From 777158c60c84234f9385d65d518be16d57f5b6c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?A=CC=81lvaro=20Velad=20Galva=CC=81n?= Date: Mon, 24 Jun 2024 12:13:11 +0200 Subject: [PATCH] fix(DASH): Allow play when SegmentTimeline has a duration 0 "S" element --- lib/dash/mpd_utils.js | 6 +++--- test/dash/mpd_utils_unit.js | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/dash/mpd_utils.js b/lib/dash/mpd_utils.js index 605f5029dd..a0755aa353 100644 --- a/lib/dash/mpd_utils.js +++ b/lib/dash/mpd_utils.js @@ -166,9 +166,9 @@ shaka.dash.MpdUtils = class { if (!d) { shaka.log.warning( - '"S" element must have a duration:', - 'ignoring the remaining "S" elements.', timePoint); - return timeline; + '"S" element must have a duration: ignoring this element.', + timePoint); + continue; } let startTime = t != null ? t : lastEndTime; diff --git a/test/dash/mpd_utils_unit.js b/test/dash/mpd_utils_unit.js index c63d16a0eb..01640a26ed 100644 --- a/test/dash/mpd_utils_unit.js +++ b/test/dash/mpd_utils_unit.js @@ -373,7 +373,7 @@ describe('MpdUtils', () => { checkTimePoints(timePoints, result, 1, 0, 20); }); - it('ignores elements after null duration', () => { + it('ignores elements with null duration', () => { const timePoints = [ createTimePoint(0, 10, 0), createTimePoint(10, 10, 0), @@ -383,7 +383,9 @@ describe('MpdUtils', () => { ]; const result = [ {start: 0, end: 10}, - {start: 10, end: 20}, + {start: 10, end: 30}, + {start: 30, end: 40}, + {start: 40, end: 50}, ]; checkTimePoints(timePoints, result, 1, 0, Infinity); });