Skip to content

Commit

Permalink
Fix regression (v0.14.1) in audio-remuxer where bad samples mid fragm…
Browse files Browse the repository at this point in the history
…ent were not being dropped, resulting in stretching of audio track duration once appended

Test stream (4 second segment with one out of sequence audio sample) https://playertest.longtailvideo.com/adaptive/audio-sample-out-of-sequence/main.m3u8
  • Loading branch information
Rob Walch committed Aug 7, 2020
1 parent 236772b commit e88d540
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/remux/mp4-remuxer.js
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ class MP4Remuxer {

// If we're overlapping by more than a duration, drop this sample
if (delta <= -maxAudioFramesDrift * inputSampleDuration) {
if (contiguous) {
if (contiguous || i > 0) {
logger.warn(`Dropping 1 audio frame @ ${toMsFromMpegTsClock(nextPts, true) / 1000}s due to ${toMsFromMpegTsClock(delta, true)} ms overlap.`);
inputSamples.splice(i, 1);
// Don't touch nextPtsNorm or i
Expand Down

0 comments on commit e88d540

Please sign in to comment.