From 60f6471c5a771222e6ec16e01c30ee6657cdf508 Mon Sep 17 00:00:00 2001 From: Bertrand Berthelot Date: Fri, 3 Jul 2020 15:32:41 +0200 Subject: [PATCH] Fix ScheduleController (re) start in case of track switch --- src/streaming/Stream.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/streaming/Stream.js b/src/streaming/Stream.js index ef76529fe8..92a77fbce9 100644 --- a/src/streaming/Stream.js +++ b/src/streaming/Stream.js @@ -633,11 +633,13 @@ function Stream(config) { streamInfo: streamInfo, liveStartTime: getLiveStartTime() }); + } - // Start ScheduleController in case stream initialization has been completed after 'play' event (case for SegmentBase streams) - for (let i = 0; i < ln && streamProcessors[i]; i++) { - streamProcessors[i].getScheduleController().start(); - } + // (Re)start ScheduleController: + // - in case stream initialization has been completed after 'play' event (case for SegmentBase streams) + // - in case stream is complete but a track switch has been requested + for (let i = 0; i < ln && streamProcessors[i]; i++) { + streamProcessors[i].getScheduleController().start(); } }