[vlc-commits] wasapi: provide user-friendly audio endpoint name (fixes #7201)

Rémi Denis-Courmont git at videolan.org
Sat Aug 11 21:41:56 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Aug 11 22:40:50 2012 +0300| [f03a60731299da6d37063be3039e19d2fc7261a9] | committer: Rémi Denis-Courmont

wasapi: provide user-friendly audio endpoint name (fixes #7201)

Also list the entries in the log like ALSA output.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f03a60731299da6d37063be3039e19d2fc7261a9
---

 modules/audio_output/wasapi.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/modules/audio_output/wasapi.c b/modules/audio_output/wasapi.c
index 273571c..144e798 100644
--- a/modules/audio_output/wasapi.c
+++ b/modules/audio_output/wasapi.c
@@ -30,6 +30,7 @@
 #include <audioclient.h>
 #include <audiopolicy.h>
 #include <mmdeviceapi.h>
+#include <Functiondiscoverykeys_devpkey.h>
 
 #include <vlc_common.h>
 #include <vlc_plugin.h>
@@ -283,6 +284,8 @@ static void GetDevices(vlc_object_t *obj, IMMDeviceEnumerator *it)
     hr = IMMDeviceCollection_GetCount(devs, &n);
     if (FAILED(hr))
         n = 0;
+    else
+        msg_Dbg(obj, "Available Windows Audio devices:");
     while (n > 0)
     {
         IMMDevice *dev;
@@ -311,16 +314,15 @@ static void GetDevices(vlc_object_t *obj, IMMDeviceEnumerator *it)
             PROPVARIANT v;
 
             PropVariantInit(&v);
-#ifdef FIXED
-            hr = IPropertyStore_GetValue(props, PKEY_Device_FriendlyName, &v);
+            hr = IPropertyStore_GetValue(props, &PKEY_Device_FriendlyName, &v);
             if (SUCCEEDED(hr))
                 text.psz_string = FromWide(v.pwszVal);
-#endif
             PropVariantClear(&v);
             IPropertyStore_Release(props);
         }
         IMMDevice_Release(dev);
 
+        msg_Dbg(obj, "%s (%s)", val.psz_string, text.psz_string);
         var_Change(obj, "audio-device", VLC_VAR_ADDCHOICE, &val, &text);
         if (likely(text.psz_string != val.psz_string))
             free(text.psz_string);



More information about the vlc-commits mailing list