Force a minimum of two periods for duplex mode.

Not all backends have the notion of a period, but for those that do this
can make it a bit more reliable.
This commit is contained in:
David Reid
2026-01-13 10:47:32 +10:00
parent d1316a58cf
commit 51f8235bef
+6
View File
@@ -44987,6 +44987,9 @@ MA_API ma_result ma_device_init(ma_context* pContext, const ma_device_config* pC
if (descriptorPlayback.periodCount == 0) {
descriptorPlayback.periodCount = MA_DEFAULT_PERIODS;
}
if (descriptorPlayback.periodCount < 2 && pConfig->deviceType == ma_device_type_duplex) {
descriptorPlayback.periodCount = 2;
}
MA_ZERO_OBJECT(&descriptorCapture);
@@ -45003,6 +45006,9 @@ MA_API ma_result ma_device_init(ma_context* pContext, const ma_device_config* pC
if (descriptorCapture.periodCount == 0) {
descriptorCapture.periodCount = MA_DEFAULT_PERIODS;
}
if (descriptorCapture.periodCount < 2 && pConfig->deviceType == ma_device_type_duplex) {
descriptorCapture.periodCount = 2;
}
/* Starting and stopping must be mutually exclusive. We just use a mutex for this. */
#ifndef MA_NO_THREADING