diff --git a/src/streaming/StreamProcessor.js b/src/streaming/StreamProcessor.js index e5c3d504c5..55492d744e 100644 --- a/src/streaming/StreamProcessor.js +++ b/src/streaming/StreamProcessor.js @@ -75,6 +75,7 @@ function StreamProcessor(config) { let boxParser = config.boxParser; let instance, + logger, isDynamic, mediaInfo, mediaInfoArr, @@ -86,6 +87,7 @@ function StreamProcessor(config) { streamInitialized; function setup() { + logger = Debug(context).getInstance().getLogger(instance); resetInitialSettings(); eventBus.on(Events.STREAM_INITIALIZED, onStreamInitialized, instance); @@ -645,7 +647,9 @@ function StreamProcessor(config) { const currentRepresentationInfo = getRepresentationInfo(); const liveEdge = liveEdgeFinder.getLiveEdge(currentRepresentationInfo); - const startTime = liveEdge - playbackController.computeLiveDelay(currentRepresentationInfo.fragmentDuration, currentRepresentationInfo.mediaInfo.streamInfo.manifestInfo.DVRWindowSize); + const liveDelay = playbackController.computeLiveDelay(currentRepresentationInfo.fragmentDuration, currentRepresentationInfo.mediaInfo.streamInfo.manifestInfo.DVRWindowSize); + const startTime = liveEdge - liveDelay; + logger.debug('live edge: ' + liveEdge + ', live delay: ' + liveDelay + ', live target: ' + startTime); const request = getFragmentRequest(currentRepresentationInfo, startTime, { ignoreIsFinished: true }); diff --git a/src/streaming/controllers/PlaybackController.js b/src/streaming/controllers/PlaybackController.js index 86baeb11fc..0660765f71 100644 --- a/src/streaming/controllers/PlaybackController.js +++ b/src/streaming/controllers/PlaybackController.js @@ -210,6 +210,11 @@ function PlaybackController() { } function setLiveStartTime(value) { + if (liveStartTime !== streamInfo.start) { + // Consider only 1st live start time (set by video stream or audio if audio only) + return; + } + logger.info('Set live start time: ' + value); liveStartTime = value; }