[vlc-devel] [PATCH 2/2] es_out: really update fmt on ES_OUT_SET_ES_FMT

Rémi Denis-Courmont remi at remlab.net
Wed Jun 17 19:12:40 CEST 2015

Le mercredi 17 juin 2015, 18:46:47 Francois Cartegnie a écrit :
> Le 16/06/2015 20:06, Rémi Denis-Courmont a écrit :
> > Le 2015-06-16 19:24, Francois Cartegnie a écrit :
> >> We want to update format and decoder without having to
> >> es_out_Add/es_out_Del which would alter id and selected state.
> > 
> > Looks OK. I fear this might expose some interesting side effects or
> > unimplemented corner cases though.
> Doesn't behave well for me with large buffers.
> Is there a safe way to guarantee that the previous decoder consumes the
> es before deletion ?

You can kick draining with input_DecoderDrain() and poll for completion with 
input_DecoderIsEmpty(). We could add a cleaner function to drain and wait for 

But doing that will probably be even worse: If you wait for decoder draining 
completion, you will create the new decoder too late to buffer. Plus, you will 
block the whole input thread in the mean time, so it will probably also affect 
other elementary streams.

You would instead need both old and new decoders running at the same time, so 
that you can switch with glitch. That would have a major impact on the audio 
and video outputs though.

Rémi Denis-Courmont

More information about the vlc-devel mailing list