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

Naohiro KORIYAMA nkoriyama at gmail.com
Mon Sep 19 16:44:34 CEST 2011

Hi Janne,

2011/9/19 Janne Kujanpää <jikuja at iki.fi>:
> Naohiro KORIYAMA <nkoriyama <at> gmail.com> writes:
> Hello,
> your patch unfortunately have problems when PCR wrap around to zero. This
> happens once per 25,5 hours so when replaying DVB recordings there is always
> good probability to have PCR wrapped around in those file(s). Also no position
> no time and no legth are calculated with those files.

What a bad timing...
I sent a patch for PCR wrap around probelm about 2 hours ago.
Can you check it?

> Example files: in http://users.utu.fi/jikuja/tmp/vlc/ (vdr-ts-PCR-wrap-long.ts
> vdr-ts-PCR-wrap-short.ts)

On my environment,
vdr-ts-PCR-wrap-short.ts: duration:3:04 position:ok
vdr-ts-PCR-wrap-long.ts: duration:3:27 position:ok

MediaInfo shows the same results.

> Next problem: How does it work when part is cut out from ts file? Example file:
> vdr-ts-PCR-cut-out.ts File has first 20s ts, cut out 40s and then 30s. After cut
> current time jump till 1:00. With this time is calculated but length and
> position aren't. Is seeking based time now? If so how does it behave with this
> kind of files?

I cannot access the file vdr-ts-PCR-cut-out.ts. access forbidden.
But I think if the ts file is cut (cut TV commercial or so) and PCRs
are not adjusted,
duration time and position will show wrong value.
Duration time and position is calculated the following method:
Duration time: (last PCR - first PCR) / 90 / 1000
Position: (current PCR - first PCR) / 90 / 1000

I only suppose that PCRs are continuous.

> Regression bugs: with your patch when playing ts files position is always zero.
> Breaks git:
> http://git.videolan.org/?p=vlc.git;a=commit;h=a0d300293418d23286b7b24658de4cae99bd87d2

The patch, I sent 2 hours ago,  may fix that issue.


nkoriyama at gmail.com

More information about the vlc-devel mailing list