wasapi: don't mark capture devices as failed for AUDCLNT_S_BUFFER_EMPTY.
authorRyan C. Gordon <icculus@icculus.org>
Fri, 19 May 2017 12:40:55 -0400
changeset 110144210074a33c8
parent 11013 06a6583f0fda
child 11015 b00c4088f687
wasapi: don't mark capture devices as failed for AUDCLNT_S_BUFFER_EMPTY.

Fixes Bugzilla #3633.
src/audio/wasapi/SDL_wasapi.c
     1.1 --- a/src/audio/wasapi/SDL_wasapi.c	Thu May 18 21:00:11 2017 -0400
     1.2 +++ b/src/audio/wasapi/SDL_wasapi.c	Fri May 19 12:40:55 2017 -0400
     1.3 @@ -563,7 +563,9 @@
     1.4          DWORD flags = 0;
     1.5  
     1.6          ret = IAudioCaptureClient_GetBuffer(this->hidden->capture, &ptr, &frames, &flags, NULL, NULL);
     1.7 -        WasapiFailed(this, ret); /* mark device lost/failed if necessary. */
     1.8 +        if (ret != AUDCLNT_S_BUFFER_EMPTY) {
     1.9 +            WasapiFailed(this, ret); /* mark device lost/failed if necessary. */
    1.10 +        }
    1.11  
    1.12          if ((ret == AUDCLNT_S_BUFFER_EMPTY) || !frames) {
    1.13              WASAPI_WaitDevice(this);