[vlc-devel] [BUG] Incorrect seek bar behavior on PCR wraparound in MPEG-TS (.ts) files
Łoś Łosiński
losiem at interia.pl
Sat May 30 08:31:51 UTC 2026
Subject: [BUG] Incorrect seek bar behavior on PCR wraparound in MPEG-TS (.ts) filesHi,I'd like to report a bug in VLC's MPEG-TS demuxer related to PCR discontinuity handling.**Component:** Input / Demuxer / MPEG-TS**Affected file type:** .ts (MPEG-2 Transport Stream)**Description:**When playing an MPEG-TS file that contains a PCR (Program Clock Reference) discontinuity where the timestamp jumps backwards (i.e. the next PCR value is lower than the previous one), VLC incorrectly calculates the playback position. As a result, the seek bar jumps to a position beyond the end of the file, and playback skips to the end.**Root cause / expected behavior:**According to the MPEG-TS specification, a backward PCR jump of this kind indicates a counter wraparound. The correct handling is to subtract 0x25800000000 (the PCR rollover value, equal to 2^33 * 300 — approximately 26.5 hours in 27 MHz clock units) from the timestamp, so that the relative timeline remains consistent. VLC does not appear to apply this correction, causing the position calculation to overflow.**Steps to reproduce:**1. Open an MPEG-TS file containing a PCR discontinuity where the next PCR value is smaller than the previous one.2. Observe the seek bar — at the point of the discontinuity it jumps to the far right (end of file).**Expected result:** VLC detects the backward PCR jump, applies the rollover correction (PCR_corrected = PCR_next - 0x25800000000), and continues playback normally with the seek bar position intact.**Actual result:** VLC computes an out-of-range playback position and jumps to the end of the file.**Reference:** ISO/IEC 13818-1 (MPEG-2 Systems), PCR wraparound and discontinuity handling.I can provide a sample .ts file demonstrating the issue if that would help:https://wetransfer.com/downloads/ddb67cd86e351cbc9318e5294da62f1520260530083020/17cbafc716e519d399c7ba479c4d813320260530083100/1db6b6?utm_source=wt_sendgrid&utm_medium=email&utm_campaign=TRN_DL_WTP_01&trk=TRN_DL_WTP_01Thanks for your work on VLC!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20260530/4c3df3e3/attachment.htm>
More information about the vlc-devel
mailing list