Commit 91e6054b03100c765ce0eda5d08ad5fa90c0b445

Ryan C. Gordon 2017-05-19T12:40:55

wasapi: don't mark capture devices as failed for AUDCLNT_S_BUFFER_EMPTY. Fixes Bugzilla #3633.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/src/audio/wasapi/SDL_wasapi.c b/src/audio/wasapi/SDL_wasapi.c
index 6574be5..69a5e97 100644
--- a/src/audio/wasapi/SDL_wasapi.c
+++ b/src/audio/wasapi/SDL_wasapi.c
@@ -563,7 +563,9 @@ WASAPI_CaptureFromDevice(_THIS, void *buffer, int buflen)
         DWORD flags = 0;
 
         ret = IAudioCaptureClient_GetBuffer(this->hidden->capture, &ptr, &frames, &flags, NULL, NULL);
-        WasapiFailed(this, ret); /* mark device lost/failed if necessary. */
+        if (ret != AUDCLNT_S_BUFFER_EMPTY) {
+            WasapiFailed(this, ret); /* mark device lost/failed if necessary. */
+        }
 
         if ((ret == AUDCLNT_S_BUFFER_EMPTY) || !frames) {
             WASAPI_WaitDevice(this);