[vlc-devel] [PATCH v3 2/6] clock: add vlc_clock_main_SetInputDrift

Alexandre Janniaux ajanni at videolabs.io
Tue Mar 16 18:52:31 UTC 2021


On Tue, Mar 16, 2021 at 07:23:21PM +0200, Rémi Denis-Courmont wrote:
> Le tiistaina 16. maaliskuuta 2021, 18.13.23 EET Thomas Guillem a écrit :
> > > I don't expect anything good to come out of that.
> >
> > It will be used only for inputs with access that can't control the pace
> > (udp, live...) and it's already the case in 3.0.
> I don't think that's how it works in 3.0, no.
> As far as I know, in 3.0, the master clock is always the RTC. If the input is
> paced, then it is adjusted according to a low-pass filter of SetPCR call
> timings. This is wrong and very noisy as those SetPCR calls are used by
> demuxer according to ES buffers, not time/clock.
> Indeed, this method has been known to cause issues:
> - Sometimes playback never "catches up".
> - Especially as start/resume, doppler sound effect (resampling) due to
> abnormally quick succession of SetPCR calls.

I'm not sure to understand, those issues arise with paced inputs
but Thomas has been explicitely saying for three mails and in the
patch itself that it copies the behaviour from 3.0 for non-paced

> In 4.0, the master clock is no longer always the RTC, and the audio output
> timing is handled differently in 4.0 as it was in 3.0.
> So it's like comparing apples and oranges.

AFAIU Thomas is not trying to change the design of the clock. He
is actually implementing what's in the design document from how it
has been implemented previously, while wrapping it around the design
of the main clock:

    ## New clock system

    The idea of the new clock system is to have multiple pluggable clocks, one of
    which being the master clock, that could be selected depending on the

    For example, you could have an **audio master clock** *(local files)*, an
    **input PCR master clock** *(streaming)*, a **video master clock** *(V-Sync)*
    or a future **external clock** *(SDI, netsync...)*.  In the *audio master
    clock* mode, VLC would not resample the audio anymore.

    As previously, there is one clock per input-program.  This **main clock** is
    therefore mostly at the es_out level and manages mostly the [PTS][] of all the
    Elementary stream/

Alexandre Janniaux

More information about the vlc-devel mailing list