From b99e64a0e3759d326b53578516a4ca5084046e7c Mon Sep 17 00:00:00 2001
From: Chris Robinson <chris.kcat@gmail.com>
Date: Sat, 3 Feb 2018 13:54:42 -0800
Subject: Provide more descriptive messages to disconnection events

---
 Alc/backends/dsound.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

(limited to 'Alc/backends/dsound.c')

diff --git a/Alc/backends/dsound.c b/Alc/backends/dsound.c
index 3d130615..bca8b7f0 100644
--- a/Alc/backends/dsound.c
+++ b/Alc/backends/dsound.c
@@ -267,7 +267,7 @@ FORCE_ALIGN static int ALCdsoundPlayback_mixerProc(void *ptr)
     {
         ERR("Failed to get buffer caps: 0x%lx\n", err);
         ALCdevice_Lock(device);
-        aluHandleDisconnect(device);
+        aluHandleDisconnect(device, "Failure retrieving playback buffer info: 0x%lx", err);
         ALCdevice_Unlock(device);
         return 1;
     }
@@ -291,7 +291,7 @@ FORCE_ALIGN static int ALCdsoundPlayback_mixerProc(void *ptr)
                 {
                     ERR("Failed to play buffer: 0x%lx\n", err);
                     ALCdevice_Lock(device);
-                    aluHandleDisconnect(device);
+                    aluHandleDisconnect(device, "Failure starting playback: 0x%lx", err);
                     ALCdevice_Unlock(device);
                     return 1;
                 }
@@ -339,7 +339,7 @@ FORCE_ALIGN static int ALCdsoundPlayback_mixerProc(void *ptr)
         {
             ERR("Buffer lock error: %#lx\n", err);
             ALCdevice_Lock(device);
-            aluHandleDisconnect(device);
+            aluHandleDisconnect(device, "Failed to lock output buffer: 0x%lx", err);
             ALCdevice_Unlock(device);
             return 1;
         }
@@ -894,7 +894,8 @@ static ALCboolean ALCdsoundCapture_start(ALCdsoundCapture *self)
     if(FAILED(hr))
     {
         ERR("start failed: 0x%08lx\n", hr);
-        aluHandleDisconnect(STATIC_CAST(ALCbackend, self)->mDevice);
+        aluHandleDisconnect(STATIC_CAST(ALCbackend, self)->mDevice,
+                            "Failure starting capture: 0x%lx", hr);
         return ALC_FALSE;
     }
 
@@ -909,7 +910,8 @@ static void ALCdsoundCapture_stop(ALCdsoundCapture *self)
     if(FAILED(hr))
     {
         ERR("stop failed: 0x%08lx\n", hr);
-        aluHandleDisconnect(STATIC_CAST(ALCbackend, self)->mDevice);
+        aluHandleDisconnect(STATIC_CAST(ALCbackend, self)->mDevice,
+                            "Failure stopping capture: 0x%lx", hr);
     }
 }
 
@@ -959,7 +961,7 @@ static ALCuint ALCdsoundCapture_availableSamples(ALCdsoundCapture *self)
     if(FAILED(hr))
     {
         ERR("update failed: 0x%08lx\n", hr);
-        aluHandleDisconnect(device);
+        aluHandleDisconnect(device, "Failure retrieving capture data: 0x%lx", hr);
     }
 
 done:
-- 
cgit v1.2.3