[vlc-devel] [PATCH] lib: add libvlc_audio_output_device_get()

Rémi Denis-Courmont remi at remlab.net
Mon Jan 26 21:45:30 CET 2015

Le lundi 26 janvier 2015, 19:34:19 Mark Lee a écrit :
> I use libvlc_audio_output_device_enum() to build a menu in my LibVLC
> application with a menu item for each returned audio output device.
> The problem is how to determine which audio output device is currently
> the active one, and consequently which menu item to show as selected.

> This patch adds a complementary API to libvlc_audio_output_device_set()
> to get the identifier of the currently active audio device (if there is
> one).

The problem is how do you know when to query that. The active device can 
change without a call to libvlc_audio_output_device_set(), and worse yet, the 
initial value is likely unset/unknown.

This is not much of an issue if the menu is populated just before it is shown, 
like the VLC UI does. It is an issue if the application wants to keep track of 
devices though.

I am fine with the code, but there should be more explicit warnings in the 

Rémi Denis-Courmont

More information about the vlc-devel mailing list