Skip to content

Commit

Permalink
Merge pull request video-dev#1513 from jon-valliere/master
Browse files Browse the repository at this point in the history
RemuxVideo method called with incorrect number of parameters; accurateTimeOffset is lost
  • Loading branch information
mangui authored Jan 20, 2018
2 parents 544b0ec + 50a5e49 commit 2d595f0
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 2d595f0

Please sign in to comment.