Fix a possible deadlock.

Public issue https://github.com/mackron/miniaudio/issues/919
This commit is contained in:
David Reid
2025-01-04 17:52:18 +10:00
parent d628284548
commit 51e005369f
+2
View File
@@ -42525,6 +42525,7 @@ MA_API ma_result ma_device_start(ma_device* pDevice)
while another was waiting on the mutex.
*/
if (ma_device_get_state(pDevice) == ma_device_state_started) {
ma_mutex_unlock(&pDevice->startStopLock);
return MA_SUCCESS; /* Already started. */
}
@@ -42593,6 +42594,7 @@ MA_API ma_result ma_device_stop(ma_device* pDevice)
while another was waiting on the mutex.
*/
if (ma_device_get_state(pDevice) == ma_device_state_stopped) {
ma_mutex_unlock(&pDevice->startStopLock);
return MA_SUCCESS; /* Already stopped. */
}