[vlc-devel] [PATCH 12/24] [demux/dirac] Trying to make dirac demuxing work with --input-slave

David Flynn davidf+nntp at woaf.net
Mon Nov 10 22:42:19 CET 2008


On 2008-11-10, Laurent Aimar <fenrir at via.ecp.fr> wrote:
> On Fri, Nov 07, 2008, David Flynn wrote:
>> > @@ -146,6 +149,9 @@ static int Demux( demux_t *p_demux)
>> > +            p_block_out->i_dts += p_sys->i_offset;
>> > +            p_block_out->i_pts += p_sys->i_offset;
>> > +            p_sys->i_dts = p_block_out->i_dts;
>> >              es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_block_out->i_dts );
>> >              es_out_Send( p_demux->out, p_sys->p_es, p_block_out );
>> >  
>> > @@ -160,13 +166,33 @@ static int Demux( demux_t *p_demux)
>> >   *****************************************************************************/
>> >  static int Control( demux_t *p_demux, int i_query, va_list args )
>> >  {
>> > -    /* demux_sys_t *p_sys  = p_demux->p_sys; */
>> > -    /* FIXME calculate the bitrate */
>> > -    if( i_query == DEMUX_SET_TIME )
>> > -        return VLC_EGENERIC;
>> > +    demux_sys_t *p_sys  = p_demux->p_sys;
>> > +    if( DEMUX_SET_TIME == i_query )
>> > +    {
>> > +        int64_t i64 = (int64_t)va_arg( args, int64_t );
>> > +        p_sys->i_offset = i64;
>> > +        return VLC_SUCCESS;
>> > +    }
>> > +    else if( DEMUX_GET_TIME == i_query )
>> > +    {
>> > +        int64_t *pi64 = (int64_t*)va_arg( args, int64_t * );
>> > +        *pi64 = p_sys->i_dts;
>> > +        return VLC_SUCCESS;
>> > +    }
>> [snip]
>> 
>> Is this all completely bogus?  I think i'm slightly confused as to what
>> DEMUX_SET_TIME is for.
>
> * DEMUX_SET_TIME is for seeking by time.

Ok, so my SET_TIME is bogus (i add that as an offset to everything)

> * DEMUX_GET_TIME is for retreiving the current time.
> with time expressed in microsecond.
[snip]
>  When implementing a demux that can work as slave, it is important to have
> pcr/pts/dts using the same origin than the value returned by DEMUX_GET_TIME.

Right, so the above is correct for GET_TIME?

How does VLC then align the two streams -- eg, assume something like rawvid
and rawaudio; is it possible for the following to occur:

Audio PTS [  7  8  9 10 11 12 ...] -vlc-alignment-> [0 1 2 3 4 5 ...]
Video PTS [ 10 11 12 13 14 15 ...] -vlc-alignment-> [0 1 2 3 4 5 ...]
?

..david




More information about the vlc-devel mailing list