Skip to content

Commit

Permalink
-1.0-bad_key_frame_timestamps
Browse files Browse the repository at this point in the history
fix broken playlist generator diagnostics
  • Loading branch information
igorshevach committed Sep 13, 2016
1 parent 6d867c0 commit 4c16043
Show file tree
Hide file tree
Showing 4 changed files with 157 additions and 161 deletions.
2 changes: 1 addition & 1 deletion lib/playlistGenerator/ConcatSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ ConcatSource.prototype.concatClip = function (fileInfo,track) {
if( track.keyFrameDTS && track.keyFrameDTS.length) {

var keyFrameDTS = _.filter(track.keyFrameDTS,function(dts) {
return dts < duration && dts > 0;
return dts >= 0 && dts < duration;
});

if(keyFrameDTS.length === 0 || _.any(keyFrameDTS,(dts,index) => { return index > 0 && dts <= keyFrameDTS[index-1] } )){
Expand Down
4 changes: 2 additions & 2 deletions lib/playlistGenerator/Playlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,10 +489,10 @@ Playlist.prototype.getDiagnostics = function (opts) {
now:Math.floor((Date.now() - that.inner.segmentBaseTime) / clipDuration),
window: {},
windowDurationMs: totalDuration,
gaps: that.inner.gaps.toHumanReadable(clipDuration)
gaps: that.gaps.toHumanReadable(clipDuration)
};

if(that.minMax && keys.length > 0) {
if(that.minMax) {
var range = that.minMax,
min = Math.floor((range.min - that.inner.segmentBaseTime) / clipDuration),
max = Math.floor((range.max - that.inner.segmentBaseTime) / clipDuration);
Expand Down
4 changes: 0 additions & 4 deletions lib/playlistGenerator/PlaylistGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,12 +405,8 @@ PlaylistGenerator.prototype.toJSON = function () {
var that = this;
var diag = that.getDiagnostics();
diag.playlistPath = that.playlistPath;
diag.reoderCounter = that.reorderCounter;
diag.gapsCounter = that.gapsCounter;
diag.config = that.playListLimits;
if(playlistUtils.playlistConfig.debug){
diag.palylist = that.playlistImp;
}
return diag;
};

Expand Down
Loading

0 comments on commit 4c16043

Please sign in to comment.