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