Commit 2024cfb2 authored by dmitrykos's avatar dmitrykos

wasapi: fixed capturing (Input stream) if Polling mode is used,...

wasapi: fixed capturing (Input stream) if Polling mode is used, ProcessInputBuffer was broken erroneously returning AUDCLNT_S_BUFFER_EMPTY and thus breaking Input thread.

git-svn-id: 0f58301d-fd10-0410-b4af-bbb618454e57
parent 2bfdfb73
......@@ -3719,14 +3719,17 @@ static HRESULT ProcessInputBuffer(PaWasapiStream *stream, PaWasapiHostProcessor
for (;;)
// Check if blocking call must be interrupted
if (WaitForSingleObject(stream->hCloseRequest, 1) != WAIT_TIMEOUT)
if (WaitForSingleObject(stream->hCloseRequest, 0) != WAIT_TIMEOUT)
// Get the available data in the shared buffer.
if ((hr = IAudioCaptureClient_GetBuffer(stream->cclient, &data, &frames, &flags, NULL, NULL)) != S_OK)
hr = S_OK;
break; // capture buffer exhausted
return LogHostError(hr);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment