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

Thomas Guillem thomas at gllm.fr
Fri Mar 23 10:13:58 CET 2018



On Fri, Mar 23, 2018, at 09:53, Rémi Denis-Courmont wrote:
> 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.
> 

OK, then the "qt: fix wrong audio settings with automatic device" commit is wrong. I should revert it.

> 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.

This patch doesn't use vlc_object_get_name() but module_get_object().

As far as this patch is concerted, even if I revert the qt simple_preferences patch, I'll still need it for the "qt: win32: add "Digital Output" checkbox in audio device menu" patch.

Maybe we should merge it like that for 3.0, and add a proper API in aout to propose an option to enable/disable the passthrough.

Something like:

/* -1: This aout should not change the digital output state (like pulseaudio)
 *  0: Disabled
 *  1: Enabled
 */
int aout_GetDigitalOutput(audio_output_t *aout);

void aout_SetDigitalOutputEnabled(audio_output_t *aout, bool enabled);

> 
> -- 
> Rémi Denis-Courmont
> _______________________________________________
> 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