]> Repos - portaudio/commitdiff
wasapi: fixed very rare bug causing a dead looping if WASAPI input stream is being...
authordmitrykos <dmitrykos@0f58301d-fd10-0410-b4af-bbb618454e57>
Tue, 22 Jun 2010 19:53:00 +0000 (19:53 +0000)
committerdmitrykos <dmitrykos@0f58301d-fd10-0410-b4af-bbb618454e57>
Tue, 22 Jun 2010 19:53:00 +0000 (19:53 +0000)
src/hostapi/wasapi/pa_win_wasapi.c

index 65e6ba7aeb13d4061615bfe9ef07e905adaa0f74..990a142d5e82083d269b96ca6ab8212ae20c9cee 100644 (file)
@@ -3361,6 +3361,10 @@ static HRESULT ProcessInputBuffer(PaWasapiStream *stream, PaWasapiHostProcessor
 \r
        for (;;)\r
        {\r
+               // Check if blocking call must be interrupted\r
+               if (WaitForSingleObject(stream->hCloseRequest, 1) != 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