Skip to content
Snippets Groups Projects

demux: mkv: shift the timestamps based on the biggest CodecDelay

Merged Steve Lhomme requested to merge robUx4/vlc:mkv-opus-start into master

The CodecDelay needs to be substracted from the PTS of all frames of that track. That may result in negative DTS, PTS and PCR which is not well handled. So we just shift all timestamps based on the biggest CodecDelay so all timestamps are always positive.

This is in line with how libavformat reports the timestamps on frames from a track with a CodecDelay.

This is done per segment as other segments may use a different CodecDelay per track.

Only Opus tracks have CodecDelay, so most of the time no shifting will happen.

Successive remuxing will result in added PCR shift (but the muxer can remove the offset). As long as VLC_TICK_INVALID is 0 we can't really handle negative timestamps correctly.

Ref. #25129 (closed)

Merge request reports

Merge request pipeline #163141 passed

Merge request pipeline passed for 45036317

Merged by Jean-Baptiste KempfJean-Baptiste Kempf 3 years ago (Nov 27, 2021 10:07am UTC)

Loading

Pipeline #163148 passed

Pipeline passed for 45036317 on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading