// get available frames\r
if ((hr = _PollGetOutputFramesAvailable(stream, &o_frames)) != S_OK)\r
{\r
+ // release input buffer\r
+ IAudioCaptureClient_ReleaseBuffer(stream->captureClient, 0);\r
+\r
LogHostError(hr);\r
break;\r
}\r
stream->out.monoBuffer = PaWasapi_ReallocateMemory(stream->out.monoBuffer, (stream->out.monoBufferSize = mono_frames_size));\r
if (stream->out.monoBuffer == NULL)\r
{\r
+ // release input buffer\r
+ IAudioCaptureClient_ReleaseBuffer(stream->captureClient, 0);\r
+ // release output buffer\r
+ IAudioRenderClient_ReleaseBuffer(stream->renderClient, 0, 0);\r
+\r
LogPaError(paInsufficientMemory);\r
break;\r
}\r
stream->in.monoBuffer = PaWasapi_ReallocateMemory(stream->in.monoBuffer, (stream->in.monoBufferSize = mono_frames_size));\r
if (stream->in.monoBuffer == NULL)\r
{\r
+ // release input buffer\r
+ IAudioCaptureClient_ReleaseBuffer(stream->captureClient, 0);\r
+ // release output buffer\r
+ IAudioRenderClient_ReleaseBuffer(stream->renderClient, 0, 0);\r
+\r
LogPaError(paInsufficientMemory);\r
break;\r
}\r
BYTE *i_data = NULL, *o_data = NULL, *o_data_host = NULL;\r
DWORD i_flags = 0;\r
UINT32 o_frames = 0;\r
- //BOOL repeat = FALSE;\r
-\r
- // going below 1 msec resolution, switching between 1 ms and no waiting\r
- //if (stream->in.shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE)\r
- // sleep_ms = !sleep_ms;\r
\r
// Get next sleep time\r
if (sleep_ms == 0)\r
break;\r
}\r
\r
- //PA_DEBUG(("full-duplex: o_frames[%d] i_frames[%d] repeat[%d]\n", o_frames, i_frames, repeat));\r
- //repeat = TRUE;\r
-\r
// process equal ammount of frames\r
if (o_frames >= i_frames)\r
{\r
stream->out.monoBuffer = PaWasapi_ReallocateMemory(stream->out.monoBuffer, (stream->out.monoBufferSize = mono_frames_size));\r
if (stream->out.monoBuffer == NULL)\r
{\r
+ // release input buffer\r
+ IAudioCaptureClient_ReleaseBuffer(stream->captureClient, 0);\r
+ // release output buffer\r
+ IAudioRenderClient_ReleaseBuffer(stream->renderClient, 0, 0);\r
+\r
LogPaError(paInsufficientMemory);\r
goto thread_error;\r
}\r
stream->in.monoBuffer = PaWasapi_ReallocateMemory(stream->in.monoBuffer, (stream->in.monoBufferSize = mono_frames_size));\r
if (stream->in.monoBuffer == NULL)\r
{\r
+ // release input buffer\r
+ IAudioCaptureClient_ReleaseBuffer(stream->captureClient, 0);\r
+ // release output buffer\r
+ IAudioRenderClient_ReleaseBuffer(stream->renderClient, 0, 0);\r
+\r
LogPaError(paInsufficientMemory);\r
goto thread_error;\r
}\r