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

Naohiro KORIYAMA nkoriyama at gmail.com
Thu Sep 22 03:51:47 CEST 2011


2011/9/22 Janne Kujanpää <jikuja at iki.fi>:
> Your patch works perfectly with uncut TS files. For cut files i modified
> your patch to make TS demuxer behave like it was in 1.1 version and/or
> vanilla 1.2.

Thank you for testing.
I recognize that my patch would have a problem with ts file which PCR
are not continuous.

> Changes for noncontinuous TS:
> I added option to disable length and time information generation because
> those can grow/shift a lot. This is only cosmetic change or does someone
> know anything which it can have undesired effects?

I think ts-disable-time option is usable.
But if this option is introduced, don't call GetFirstPCR() and
GetLastPCR() like:

    if( can_seek || !var_InheritBool( p_demux, "ts-disable-time" ) )
        GetFirstPCR( p_demux );
        GetLastPCR( p_demux );

You don't need to modify other place (GET_TIME/GET_LENGTH).

>  I also modified GET_POSITION to return percent byte position if
> ts-seek-percent is set. Otherwise after SET_POSITION is called, will
> GET_POSITION return value to be SET_POSITION+[period of noncontinuous PCR
> before this point]. Without this change seekbar is jumpy with
> ts-seek-percent-option  because it moves left because GET_POSITION !=

That's right.
I need to modify GET_POSITION to get byte based position if
ts-seek-percent is set.

Best regards,

nkoriyama at gmail.com

More information about the vlc-devel mailing list