[vlc-devel] [PATCH 3/6] clock: add vlc_clock_SetDecoderLatency

Thomas Guillem thomas at gllm.fr
Tue Oct 1 14:33:00 CEST 2019

On Mon, Sep 30, 2019, at 21:52, Rémi Denis-Courmont wrote:
> Le torstaina 26. syyskuuta 2019, 17.38.11 EEST Thomas Guillem a écrit :
> > The highest decoder latency of all clocks will be used to setup the initial
> > dejitter delay.
> We cannot generally, or even usually, measure the decoder latency.

I agree, but we the avcodec module can guess it, according to its thread_count and fps. It's not perfect but it's sufficient to fix all problems we have with low fps samples (when you have a CPU with lot of cores).

> On top of that, even if we could measure it, it does not even seem to mean 
> anything if the set of active ES changes, or if for any reason the ES are not 
> in sync (input slaves, multiple RTP sessions, etc).

Yes, this is why this function can fail. vlc_clock_SetDecoderLatency() won't be able to handle a big delay ( > 300ms = file-caching) if a video track is enabled midstream. Everything is handled in avcodec:
cf. https://code.videolan.org/tguillem/vlc/commit/38206d600fe2eba78a72cc4b19749db087b6a408

This is not a perfect solution but it will fix most issues we have with normal media samples (video starting near the audio).

> -- 
> レミ・デニ-クールモン
> http://www.remlab.net/
> _______________________________________________
> 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