From bcff6ac15261de863d53df512184471ed5e9feff Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 9 Feb 2022 18:19:04 +1000 Subject: [PATCH] Don't return an error when a device is already started/stopped. --- miniaudio.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/miniaudio.h b/miniaudio.h index d47e4f82..1a501690 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -40337,7 +40337,7 @@ MA_API ma_result ma_device_start(ma_device* pDevice) } if (ma_device_get_state(pDevice) == ma_device_state_started) { - return MA_INVALID_OPERATION; /* Already started. Returning an error to let the application know because it probably means they're doing something wrong. */ + return MA_SUCCESS; /* Already started. */ } ma_mutex_lock(&pDevice->startStopLock); @@ -40397,7 +40397,7 @@ MA_API ma_result ma_device_stop(ma_device* pDevice) } if (ma_device_get_state(pDevice) == ma_device_state_stopped) { - return MA_INVALID_OPERATION; /* Already stopped. Returning an error to let the application know because it probably means they're doing something wrong. */ + return MA_SUCCESS; /* Already stopped. */ } ma_mutex_lock(&pDevice->startStopLock);