From 3c84076b38cdd2a46aac5c37bdf94de01ae79cf6 Mon Sep 17 00:00:00 2001 From: Dan Sparacio Date: Mon, 25 Jan 2016 20:43:09 -0800 Subject: [PATCH] Fix for #984 Also fixed another RTE at startup for streams with DVRwindow info that may not be present right at startup in the currentRepresentationInfo. --- src/streaming/controllers/PlaybackController.js | 4 +++- src/streaming/controllers/ScheduleController.js | 11 +++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/streaming/controllers/PlaybackController.js b/src/streaming/controllers/PlaybackController.js index 1662fac414..ae70c40187 100644 --- a/src/streaming/controllers/PlaybackController.js +++ b/src/streaming/controllers/PlaybackController.js @@ -352,8 +352,10 @@ function PlaybackController() { } function onPlaybackSeeking() { + let seekTime = getTime(); + log('Seeking to: ' + seekTime); startUpdatingWallclockTime(); - eventBus.trigger(Events.PLAYBACK_SEEKING, {seekTime: getTime()}); + eventBus.trigger(Events.PLAYBACK_SEEKING, {seekTime: seekTime}); } function onPlaybackSeeked() { diff --git a/src/streaming/controllers/ScheduleController.js b/src/streaming/controllers/ScheduleController.js index 8590db1be1..3ee6ff652b 100644 --- a/src/streaming/controllers/ScheduleController.js +++ b/src/streaming/controllers/ScheduleController.js @@ -217,7 +217,7 @@ function ScheduleController(config) { function onGetRequiredFragmentCount(result) { fragmentsToLoad = result.value; - if (fragmentsToLoad > 0 && !bufferController.getIsAppendingInProgress() && !isFragmentLoading) { + if (fragmentsToLoad > 0 && !isFragmentLoading && (manifestExt.getIsTextTrack(type) || !bufferController.getIsAppendingInProgress())) { isFragmentLoading = true; abrController.getPlaybackQuality(streamProcessor, getNextFragment(onGetNextFragment)); } else { @@ -358,19 +358,18 @@ function ScheduleController(config) { } function onPlaybackSeeking(e) { - if (!initialPlayback) { isFragmentLoading = false; } - var metrics = metricsModel.getMetricsFor('stream'); - var manifestUpdateInfo = metricsExt.getCurrentManifestUpdate(metrics); + let metrics = metricsModel.getMetricsFor('stream'); + let manifestUpdateInfo = metricsExt.getCurrentManifestUpdate(metrics); seekTarget = e.seekTime; - log('seek: ' + seekTarget); addPlaylistMetrics(PlayList.SEEK_START_REASON); - metricsModel.updateManifestUpdateInfo(manifestUpdateInfo, {latency: currentRepresentationInfo.DVRWindow.end - playbackController.getTime()}); + let latency = currentRepresentationInfo.DVRWindow ? currentRepresentationInfo.DVRWindow.end - playbackController.getTime() : NaN; + metricsModel.updateManifestUpdateInfo(manifestUpdateInfo, {latency: latency}); if (isDynamic) { // need to validate again for dynamic after first seek validate();