[vlc-devel] [vlc-commits] aout: export used module internal name

Rémi Denis-Courmont remi at remlab.net
Fri Mar 23 09:53:46 CET 2018


Le vendredi 23 mars 2018, 10:21:35 EET Thomas Guillem a écrit :
> On Fri, Mar 23, 2018, at 07:58, Rémi Denis-Courmont wrote:
> > Le jeudi 22 mars 2018, 10:47:04 EET Thomas Guillem a écrit :
> > > vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Mar 20
> > > 16:01:03 2018 +0100| [3aa4fda0d0742c7a68b57600c8bec311b3078d72] |
> > > committer: Thomas Guillem
> > > 
> > > aout: export used module internal name
> > > 
> > > This can be used by intf modules in order to show different settings
> > > depending on audio modules.
> > 
> > This looks like duplicated existing get_name functionality albeit less
> > generic but still identically flawed. get_name is only used for
> > display/debugging for a reason: it is intrisincally racy and unreliable.
> 
> Hello,
> 
> This patch doesn't use module_get_name(), but module_get_object(). This
> function is quite used by QT for preferences.

There is nothing wrong with module_get_name(). vlc_object_get_name() is the 
problem.

> The audio_output_t struct doesn't expose the module (that is a good design
> for me). But we really need a way to get the current module that is used.

Of course it does not. There might not be one module yet, or it might be 
loading, or it might be unloading, or there might be more than one aout, or 
there might not be any aout yet or at all.

vlc_object_get_name() will not race at memory level (unlike its earlier 
incarnation), but whatever value it returns is potentially invalid by the time 
you see it. It's only usable for informational display.

-- 
Rémi Denis-Courmont


More information about the vlc-devel mailing list