]> Repos - portaudio/commitdiff
wasapi: fixed capturing (Input stream) if Polling mode is used, ProcessInputBuffer...
authordmitrykos <dmitrykos@0f58301d-fd10-0410-b4af-bbb618454e57>
Wed, 20 Oct 2010 17:32:04 +0000 (17:32 +0000)
committerdmitrykos <dmitrykos@0f58301d-fd10-0410-b4af-bbb618454e57>
Wed, 20 Oct 2010 17:32:04 +0000 (17:32 +0000)
src/hostapi/wasapi/pa_win_wasapi.c

index 3b08abc9ba62603bc80936e2818f7c90753b6e75..cff3abdbcf61a2fedde2b8a106410410545bcb63 100644 (file)
@@ -3719,14 +3719,17 @@ static HRESULT ProcessInputBuffer(PaWasapiStream *stream, PaWasapiHostProcessor
        for (;;)\r
        {\r
                // Check if blocking call must be interrupted\r
-               if (WaitForSingleObject(stream->hCloseRequest, 1) != WAIT_TIMEOUT)\r
+               if (WaitForSingleObject(stream->hCloseRequest, 0) != WAIT_TIMEOUT)\r
                        break;\r
 \r
                // Get the available data in the shared buffer.\r
                if ((hr = IAudioCaptureClient_GetBuffer(stream->cclient, &data, &frames, &flags, NULL, NULL)) != S_OK)\r
                {\r
                        if (hr == AUDCLNT_S_BUFFER_EMPTY)\r
+                       {\r
+                               hr = S_OK;\r
                                break; // capture buffer exhausted\r
+                       }\r
 \r
                        return LogHostError(hr);\r
                        break;\r