Skip to content

Commit

Permalink
Fix for #984
Browse files Browse the repository at this point in the history
Also fixed another RTE at startup for streams with DVRwindow info that may not be present right at startup in the currentRepresentationInfo.
  • Loading branch information
Dan Sparacio committed Jan 26, 2016
1 parent 63fbf8d commit 3c84076
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/streaming/controllers/PlaybackController.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
11 changes: 5 additions & 6 deletions src/streaming/controllers/ScheduleController.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 3c84076

Please sign in to comment.