[vlc-commits] mmdevice: handle AUDCLNT_E_RESOURCES_INVALIDATED

Thomas Guillem git at videolan.org
Thu Sep 15 11:38:49 CEST 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Sep 15 11:31:51 2016 +0200| [c51b78caa4bc8298ba8b1d244382e8da34be1f95] | committer: Thomas Guillem

mmdevice: handle AUDCLNT_E_RESOURCES_INVALIDATED

This error is not documented but can be returned instead of
AUDCLNT_E_DEVICE_INVALIDATED when you unplug a sound card in Windows 10.

closes #17392

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

 modules/audio_output/mmdevice.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/audio_output/mmdevice.c b/modules/audio_output/mmdevice.c
index b48dbb3..28bb1e0 100644
--- a/modules/audio_output/mmdevice.c
+++ b/modules/audio_output/mmdevice.c
@@ -118,7 +118,8 @@ static int DeviceSelect(audio_output_t *, const char *);
 static int vlc_FromHR(audio_output_t *aout, HRESULT hr)
 {
     /* Select the default device (and restart) on unplug */
-    if (unlikely(hr == AUDCLNT_E_DEVICE_INVALIDATED))
+    if (unlikely(hr == AUDCLNT_E_DEVICE_INVALIDATED ||
+                 hr == AUDCLNT_E_RESOURCES_INVALIDATED))
         DeviceSelect(aout, NULL);
     return SUCCEEDED(hr) ? 0 : -1;
 }



More information about the vlc-commits mailing list