Cross a clip join per track, not on the video's frame
The first cut placed every track with the cursor the video had moved. At an overlap join the previous clip's audio is still arriving after video has crossed, and those tail frames sit inside both clips' mark ranges — so they took the new clip's offset, jumped forward by the overlap, and collided with the new clip's own audio, which the muxer's monotonic nudge then flattened. A remux confirmed it: the timeline length was already correct and the original symptom was still there, 169 audio packets on the tick floor. A track's PTS only runs forward inside a clip, so its own backward step to the next clip's IN is its crossing. That is per track, so the cursor is too.
This commit is contained in:
@@ -868,7 +868,7 @@ impl Stream for DemuxSink {
|
||||
let drives = Some(frame.track) == self.ref_video_track;
|
||||
// See `MkvMuxer::write_frame`: `None` is material outside the
|
||||
// playlist's clip marks and is dropped rather than emitted.
|
||||
let Some(pts) = self.timeline.map(frame.pts, drives) else {
|
||||
let Some(pts) = self.timeline.map(frame.pts, drives, frame.track) else {
|
||||
return Ok(());
|
||||
};
|
||||
if drives {
|
||||
|
||||
Reference in New Issue
Block a user