From 91e6054b03100c765ce0eda5d08ad5fa90c0b445 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 19 May 2017 12:40:55 -0400 Subject: [PATCH] wasapi: don't mark capture devices as failed for AUDCLNT_S_BUFFER_EMPTY. Fixes Bugzilla #3633. --- src/audio/wasapi/SDL_wasapi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/audio/wasapi/SDL_wasapi.c b/src/audio/wasapi/SDL_wasapi.c index 6574be555..69a5e9701 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);