Skip to content

mpegtsdemux: Handle PTS/DTS wraparound with ignore-pcr=true

The wraparound handling code assumes that the PCR gets updated regularly for being able to detect wraparounds. With ignore-pcr=true that was not the case and it stayed initialized at 1h forever.

To avoid this problem, update the fake PCR whenever the PTS advanced by more than 5s, and also detect wraparounds in these fake PCRs.

Problem can be reproduced with

  $ gst-launch-1.0 videotestsrc pattern=black ! video/x-raw,framerate=1/5 ! \
    x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! \
    tsdemux ignore-pcr=true ! fakesink

which restarts timestamps at 0 after around 26h30m.

Merge request reports

Loading