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

Mark Lee mark.lee at capricasoftware.co.uk
Mon Jan 26 22:05:47 CET 2015


On Mon Jan 26 2015 at 20:45:31 Rémi Denis-Courmont <remi at remlab.net> wrote:

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

Hmm... I didn't realise it might never be set.

What I observed in my testing was that it *was* set without my own
application explicitly setting it so I just assumed, incorrectly as you
point out, that that was always the case.


> This is not much of an issue if the menu is populated just before it is
> shown,
> like the VLC UI does.


This is precisely my use-case.


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

Thanks.


>
> --
> Rémi Denis-Courmont
> http://www.remlab.net/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20150126/a69af3ca/attachment.html>


More information about the vlc-devel mailing list