[vlc-devel] [PATCH v2 1/7] clock: handle the normal play time (npt) from the input

Alexandre Janniaux ajanni at videolabs.io
Wed Apr 7 09:37:56 UTC 2021


Hi,

Sure it is needed, but the NPT value represents the whole NPT
state and is used to display the time to the user on the GUI,
so it´s racy by design, so an atomic should be enough rather
than a mutex here.

Regards,
--
Alexandre Janniaux
Videolabs

On Wed, Apr 07, 2021 at 11:10:27AM +0200, Thomas Guillem wrote:
> Yes, that was I did first, but then you have to add an extra mutex.
>
> ClockUpdate() can be called by any out thread.
>
>
> On Wed, Apr 7, 2021, at 10:31, Alexandre Janniaux wrote:
> > On Wed, Apr 07, 2021 at 09:53:08AM +0200, Thomas Guillem wrote:
> > >
> > >
> > > On Sat, Apr 3, 2021, at 10:22, Rémi Denis-Courmont wrote:
> > > > Le torstaina 1. huhtikuuta 2021, 18.30.06 EEST Thomas Guillem a écrit :
> > > > > vlc_clock_t will send corrected update points directly.
> > > > >
> > > > > The player won't have to fetch the normal_time from the demux and fix
> > > > > its timer accordingly.
> > > >
> > > > I'm not convinced that the clock should know/care about NPT.
> > >
> > > The clock doesn't use it for any calculation. It is just used when passing the pts/system_date points to the clock listener (the player) and only for information purpose.
> > >
> >
> > If the clock doesn´t use it, maybe it can be sent directly
> > from the es_out to the player there:
> >
> >     static void ClockUpdate(vlc_tick_t system_ts, vlc_tick_t ts, double rate,
> >                             unsigned frame_rate, unsigned frame_rate_base,
> >                             void *data)
> >     {
> >         es_out_id_t *es = data;
> >         es_out_sys_t *p_sys = container_of(es->out, es_out_sys_t, out);
> >
> >         input_SendEventOutputClock(p_sys->p_input, &es->id, es->master,
> > system_ts,
> >                                    ts, rate, frame_rate,
> > frame_rate_base);
> >     }
> >
> > Thus, you´d just have to store the NPT in the es_out, where
> > it should mostly make sense, and the player won´t have to
> > fetch it from the demux itself either.
> >
> > > >
> > > > And if we need to track NPT per group, that seems rather problematic, because
> > > > there will be multiple NPTs for a single clock...
> > >
> > > Yes, NPT are per group, but there is also one vlc_clock_main per group, so if there are multiple NPTs, they will be handled by their respective clock (main).
> > >
> > > >
> > > > --
> > > > 雷米‧德尼-库尔蒙
> > > > http://www.remlab.net/
> > > >
> > > >
> > > >
> > > > _______________________________________________
> > > > vlc-devel mailing list
> > > > To unsubscribe or modify your subscription options:
> > > > https://mailman.videolan.org/listinfo/vlc-devel
> > > _______________________________________________
> > > vlc-devel mailing list
> > > To unsubscribe or modify your subscription options:
> > > https://mailman.videolan.org/listinfo/vlc-devel
> > _______________________________________________
> > vlc-devel mailing list
> > To unsubscribe or modify your subscription options:
> > https://mailman.videolan.org/listinfo/vlc-devel
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list