[vlc-devel] [PATCH] TS demux: get time and length

Naohiro KORIYAMA nkoriyama at gmail.com
Mon Sep 19 14:02:32 CEST 2011


Hi,

I found I cannot get a duration and a position of some TS,
because of PCR wrap around problem.

PCR is a 33bit timecode, is counted up every 90KHz.
PCR's Max value is 2^33/90000 = 95443.717 sec = 26:30:43.717.
If a PCR started from 24:30:45.000, about 2 hours later, reached to 26:30:34.717
and restarted from 00:00:00.000.
I cannot get a position because of i_first_pcr > i_current_pcr ,
also cannot get a duration because of i_first_pcr > i_last_pcr.

So, when I get i_current_pcr/i_last_pcr, if a PCR is smaller than
i_first_pcr, add 0x1FFFF to the PCR.
After this patch. I can get a duration and a position of the TS with
PCR wrap around.

Regards,
-- 
KORIYAMA, Naohiro
nkoriyama at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-TS-demux-2985-Enhance-TS-demuxer-to-support-duration.patch
Type: application/octet-stream
Size: 19311 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20110919/54a45203/attachment.obj>


More information about the vlc-devel mailing list