mal_post_error(pDevice, MAL_LOG_LEVEL_ERROR, "[WASAPI] Failed to retrieve internal buffer from playback device in preparation for writing to the device.", MAL_FAILED_TO_MAP_DEVICE_BUFFER);
mal_post_error(pDevice, MAL_LOG_LEVEL_ERROR, "[WASAPI] Failed to retrieve internal buffer from capture device in preparation for writing to the device.", MAL_FAILED_TO_MAP_DEVICE_BUFFER);
mal_post_error(pDevice, MAL_LOG_LEVEL_ERROR, "[WASAPI] Failed to release internal buffer from capture device after reading from the device.", MAL_FAILED_TO_UNMAP_DEVICE_BUFFER);
exitLoop = MAL_TRUE;
break;
}
//printf("TRACE: Released capture buffer\n");
ResetEvent(pDevice->wasapi.hEventCapture);
pMappedBufferCapture = NULL;
mappedBufferFramesRemainingCapture = 0;
mappedBufferSizeInFramesCapture = 0;
}
/* Get out of this loop if we're run out of room in the playback buffer. */
if (mappedBufferFramesRemainingPlayback == 0) {
break;
}
}
/* If at this point we've run out of data we need to release the buffer. */
if (mappedBufferFramesRemainingPlayback == 0 && pMappedBufferPlayback != NULL) {
mal_post_error(pDevice, MAL_LOG_LEVEL_ERROR, "[WASAPI] Failed to release internal buffer from playback device after writing to the device.", MAL_FAILED_TO_UNMAP_DEVICE_BUFFER);