mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-24 01:04:02 +02:00
WASAPI: Try fixing an issue with loopback mode.
Public issue https://github.com/mackron/miniaudio/issues/533
This commit is contained in:
+8
-1
@@ -22155,7 +22155,14 @@ static ma_result ma_device_read__wasapi(ma_device* pDevice, void* pFrames, ma_ui
|
|||||||
loopback mode, in which case a timeout probably just means the nothing is playing
|
loopback mode, in which case a timeout probably just means the nothing is playing
|
||||||
through the speakers.
|
through the speakers.
|
||||||
*/
|
*/
|
||||||
if (WaitForSingleObject(pDevice->wasapi.hEventCapture, MA_WASAPI_WAIT_TIMEOUT_MILLISECONDS) != WAIT_OBJECT_0) {
|
|
||||||
|
/* Experiment: Use a shorter timeout for loopback mode. */
|
||||||
|
DWORD timeoutInMilliseconds = MA_WASAPI_WAIT_TIMEOUT_MILLISECONDS;
|
||||||
|
if (pDevice->type == ma_device_type_loopback) {
|
||||||
|
timeoutInMilliseconds = 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (WaitForSingleObject(pDevice->wasapi.hEventCapture, timeoutInMilliseconds) != WAIT_OBJECT_0) {
|
||||||
if (pDevice->type == ma_device_type_loopback) {
|
if (pDevice->type == ma_device_type_loopback) {
|
||||||
continue; /* Keep waiting in loopback mode. */
|
continue; /* Keep waiting in loopback mode. */
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user