[vlc-commits] mmdevice: be informative about device state changes

Thomas Guillem git at videolan.org
Wed May 25 14:35:07 CEST 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue May 17 12:36:39 2016 -0400| [3e506d2e7fcf476fd3a36c1e5860455849654b23] | committer: Thomas Guillem

mmdevice: be informative about device state changes

Original patch by Sean McGovern <gseanmcg at gmail.com>

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

 modules/audio_output/mmdevice.c |   20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/modules/audio_output/mmdevice.c b/modules/audio_output/mmdevice.c
index 286bc9d..a46449f 100644
--- a/modules/audio_output/mmdevice.c
+++ b/modules/audio_output/mmdevice.c
@@ -613,8 +613,24 @@ vlc_MMNotificationClient_OnDeviceStateChanged(IMMNotificationClient *this,
     aout_sys_t *sys = vlc_MMNotificationClient_sys(this);
     audio_output_t *aout = sys->aout;
 
-    /* TODO: show device state / ignore missing devices */
-    msg_Dbg(aout, "device %ls state changed %08lx", wid, state);
+    switch (state) {
+        case DEVICE_STATE_UNPLUGGED:
+            msg_Dbg(aout, "device %ls state changed: unplugged", wid);
+            break;
+        case DEVICE_STATE_ACTIVE:
+            msg_Dbg(aout, "device %ls state changed: active", wid);
+            break;
+        case DEVICE_STATE_DISABLED:
+            msg_Dbg(aout, "device %ls state changed: disabled", wid);
+            break;
+        case DEVICE_STATE_NOTPRESENT:
+            msg_Dbg(aout, "device %ls state changed: not present", wid);
+            break;
+        default:
+            msg_Dbg(aout, "device %ls state changed: unknown: %08lx", wid, state);
+            break;
+    }
+
     return S_OK;
 }
 



More information about the vlc-commits mailing list