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

Naohiro KORIYAMA nkoriyama at gmail.com
Thu Oct 6 19:09:57 CEST 2011

Hi Laurent,

Thank you for reviewing.

2011/10/6 Laurent Aimar <fenrir at elivagar.org>:
>  You could also store and use the exact position to:
>  - improve the precision of the seek, and maybe (I am unsure) to avoid
>  failling seeking in case the PCR was not too close of the byte position.

I add a variable which stores the position, and modify a variable
which stores PCR from constant array to pointer.

>  It would be simpler to initialize it with var_InheritBool("ts-seek-percent")
> and it would avoid to call it at each seek.

> You could also set b_force_seek_per_percent to true here if
> i_first_pcr/i_last_pcr are not valid (will simplify later code).

>  You don't need to check the value of f, it is guaranted to be valid.

>  Setting i_current_pcr here will avoid having GET_TIME failing
> at the beginning.

I agree these things.

>  I think that it might be worth to reject (ie b_force_seek_per_percent = true)
> when they are too much PCR wraps. It will catch most of the file that have
> arbitrary PCR reset.
>  Again, that can be added later, as you prefer.

At this moment, I can't decide how many times to reject.
But I add a test at GetLastPCR(). If the bitrate of the video is too
low or too high, PCR  might have some problem.

Best regards,

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: 20631 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20111007/77671c8e/attachment.obj>

More information about the vlc-devel mailing list