Commit 04fe7201 authored by David Reid's avatar David Reid

Experimental fix for an hang when stopping devices.

Public issue https://github.com/mackron/miniaudio/issues/355
parent 5a5d523d
......@@ -12673,6 +12673,11 @@ static ma_result ma_device_audio_thread__default_read_write(ma_device* pDevice)
}
}
/* Make sure we don't get stuck in the inner loop. */
if (capturedDeviceFramesProcessed == 0) {
break;
}
totalCapturedDeviceFramesProcessed += capturedDeviceFramesProcessed;
}
} break;
......@@ -12696,6 +12701,11 @@ static ma_result ma_device_audio_thread__default_read_write(ma_device* pDevice)
break;
}
/* Make sure we don't get stuck in the inner loop. */
if (framesProcessed == 0) {
break;
}
ma_device__send_frames_to_client(pDevice, framesProcessed, capturedDeviceData);
framesReadThisPeriod += framesProcessed;
......@@ -12723,6 +12733,11 @@ static ma_result ma_device_audio_thread__default_read_write(ma_device* pDevice)
break;
}
/* Make sure we don't get stuck in the inner loop. */
if (framesProcessed == 0) {
break;
}
framesWrittenThisPeriod += framesProcessed;
}
} break;
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