Skip to content

Commit

Permalink
Fixes issue where line#82 of mp4-remuxer.js was calling remuxVideo wi…
Browse files Browse the repository at this point in the history
…th the incorrect number of parameters. Also moved the next condition statement inside of the same block because it was unnecessary to have the variable and statement outside of the same block. Added quick check for (inputSamples.length == 0) for remuxVideo just like what remuxAudio has. Successfully compiled and tested with the default playlist.
  • Loading branch information
jon-valliere committed Jan 19, 2018
1 parent 23f159d commit 50a5e49
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/remux/mp4-remuxer.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,12 @@ class MP4Remuxer {
this.remuxVideo(videoTrack,videoTimeOffset,contiguous,audioTrackLength, accurateTimeOffset);
}
} else {
let videoData;
//logger.log('nb AVC samples:' + videoTrack.samples.length);
if (nbVideoSamples) {
videoData = this.remuxVideo(videoTrack,videoTimeOffset,contiguous, accurateTimeOffset);
}
if (videoData && audioTrack.codec) {
this.remuxEmptyAudio(audioTrack, audioTimeOffset, contiguous, videoData);
let videoData = this.remuxVideo(videoTrack,videoTimeOffset,contiguous, 0, accurateTimeOffset);
if (videoData && audioTrack.codec) {
this.remuxEmptyAudio(audioTrack, audioTimeOffset, contiguous, videoData);
}
}
}
}
Expand Down Expand Up @@ -206,6 +205,9 @@ class MP4Remuxer {
let nextAvcDts = this.nextAvcDts;

const isSafari = this.isSafari;

if(inputSamples.length == 0)
return null;

// Safari does not like overlapping DTS on consecutive fragments. let's use nextAvcDts to overcome this if fragments are consecutive
if (isSafari) {
Expand Down

0 comments on commit 50a5e49

Please sign in to comment.