[vlc-devel] [PATCH] TS demux: get time and length
fenrir at elivagar.org
Sat Sep 24 18:22:53 CEST 2011
On Fri, Sep 23, 2011 at 11:17:57AM +0900, Naohiro KORIYAMA wrote:
> 2011/9/23 Janne Kujanpää <jikuja at iki.fi>:
> > I think there is still one bug to patch. What it there is two or more wrap
> > arounds in one file? It's higly theoretical problem: worst case scenario
> > with continuous PCR ~26 hours and 30 minutes, but it's still possible. Is
> > this actually real problem?
> Two or more wrap around means the duration of a file is at least over
> 26.5 hours.
> I think it is realistically impossible to play such a long file.
> To deal with the issue, I cannot think a practical solution at this time.
There are two differents issues:
1. Handle files that have PCR restarting without it being due to a PCR wrap.
2. Handle files longer than 1 PCR wraps (more than ~ 26 hours).
An obvious solution is to preparse the whole file and create a seek table,
but that would be really slow (probably too slow IMO).
Otherwise, IMO a good enough solution would be to detect such files and
simply revert to the seek-per-per-percent method. Detecting such files
with a good enough accuracy without being too slow could be done by simply
getting a few PCR throughout the file by reusing you SeekToPcr() in the Open()
function (for example, for every 10%), and checking if they behave correctly.
An improvment could be to use this coarse PCR tables to improve the Seek()
function (but that can be added later, no need to make things to complicated
in the first patch). It could also be used to support the issue (2) if we
suppose that they aren't too much PCR wraps (again, later).
More information about the vlc-devel