From 51e005369f045e529190a97637d333dee589c223 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 4 Jan 2025 17:52:18 +1000 Subject: [PATCH] Fix a possible deadlock. Public issue https://github.com/mackron/miniaudio/issues/919 --- miniaudio.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/miniaudio.h b/miniaudio.h index 67733480..9b1f3b36 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -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. */ }