Skip to content

Commit

Permalink
-added factor of 20% for chunk duration to exceed m3u8 targetduration
Browse files Browse the repository at this point in the history
  • Loading branch information
igorshevach committed Aug 31, 2016
1 parent 1c02fea commit a000f62
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/playlistGenerator/MixFilterClip.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ MixFilterClip.prototype.doValidate = function mix_doValidate(opts) {
});
};

var exceedFactor = 1.2;

var validateInput = function(fileInfo){
var that = this;

Expand Down Expand Up @@ -153,8 +155,8 @@ var validateInput = function(fileInfo){
return false;
}

if(fileInfo.targetDuration && fileInfo.targetDuration < fileInfo.video.duration){
that.logger.warn('FileInfo.video.duration > targetDuration %j > %j',fileInfo.video.duration,fileInfo.targetDuration);
if(fileInfo.targetDuration && fileInfo.targetDuration * exceedFactor < fileInfo.video.duration){
that.logger.warn('FileInfo.video.duration > targetDuration %j > %j',fileInfo.video.duration,fileInfo.targetDuration*exceedFactor);
return false;
}

Expand Down Expand Up @@ -183,8 +185,8 @@ var validateInput = function(fileInfo){
that.logger.warn('FileInfo.audio.duration <= 0');
return false;
}
if(fileInfo.targetDuration && fileInfo.targetDuration < fileInfo.audio.duration){
that.logger.warn('FileInfo.audio.duration > targetDuration %j > %j',fileInfo.audio.duration,fileInfo.targetDuration);
if(fileInfo.targetDuration && fileInfo.targetDuration * exceedFactor < fileInfo.audio.duration){
that.logger.warn('FileInfo.audio.duration > targetDuration %j > %j',fileInfo.audio.duration,fileInfo.targetDuration*exceedFactor);
return false;
}
}
Expand Down

0 comments on commit a000f62

Please sign in to comment.