[vlc-devel] [PATCH V3 02/19] clock: add AddOriginPoint

Rémi Denis-Courmont remi at remlab.net
Mon Sep 9 20:25:20 CEST 2019


Le maanantaina 9. syyskuuta 2019, 21.15.11 EEST Rémi Denis-Courmont a écrit :
> Le maanantaina 9. syyskuuta 2019, 19.15.18 EEST Thomas Guillem a écrit :
> > > Mapping play time to media timestamps is the job of the demuxer (and
> > > yes,
> > > the current DEMUX_GET_TIME/DEMUX_GET_POSITION concept is too limited).
> > 
> > Yes it should be in the demux. I put it in the clock in order to reduce
> > the
> > number of locks involved and to fix possible a lock-order-inversion.
> > 
> > After second thoughts, I can also forward an event to the player from the
> > demux when the origin changes, keeping the same lock complexity.
> 
> AFAICT, we only need a demux control to query the current offset from PCR to
> NPT - presumably with program ID as parameter - as opposed to the current
> time.

Typically:

static int DemuxControl(...)
{
...
case DEMUX_GET_GROUP_NPT:
     vlc_tick_t *ts = va_arg(ap, vlc_tick_t *);
     int group = va_arg(ap, int);

    *ts -= VLC_TS_0;
    (void) group;
    return VLC_SUCCESS;
...
}

Just pass the PCR in with potential buffer level adjustment, and get the play 
time back. We can even remove DEMUX_GET_TIME afterwards.

-- 
レミ・デニ-クールモン
http://www.remlab.net/





More information about the vlc-devel mailing list