shithub: cstory

Download patch

ref: 11b04fe93bfef03c5b5f52e64db3c053999b36d2
parent: 011cb94f73747a41d6bcce21a06513c8eac28c8a
author: Clownacy <Clownacy@users.noreply.github.com>
date: Fri Apr 17 21:38:25 EDT 2020

Update other audio backends

--- a/src/Backends/Audio/Null.cpp
+++ b/src/Backends/Audio/Null.cpp
@@ -60,8 +60,12 @@
 	(void)pan;
 }
 
-void AudioBackend_SetOrganyaCallback(void (*callback)(void), unsigned int milliseconds)
+void AudioBackend_SetOrganyaCallback(void (*callback)(void))
 {
 	(void)callback;
+}
+
+void AudioBackend_SetOrganyaTimer(unsigned int milliseconds)
+{
 	(void)milliseconds;
 }
--- a/src/Backends/Audio/SDL2.cpp
+++ b/src/Backends/Audio/SDL2.cpp
@@ -205,11 +205,19 @@
 	SDL_UnlockAudioDevice(device_id);
 }
 
-void AudioBackend_SetOrganyaCallback(void (*callback)(void), unsigned int milliseconds)
+void AudioBackend_SetOrganyaCallback(void (*callback)(void))
 {
 	SDL_LockAudioDevice(device_id);
 
 	organya_callback = callback;
+
+	SDL_UnlockAudioDevice(device_id);
+}
+
+void AudioBackend_SetOrganyaTimer(unsigned int milliseconds)
+{
+	SDL_LockAudioDevice(device_id);
+
 	organya_callback_milliseconds = milliseconds;
 
 	SDL_UnlockAudioDevice(device_id);
--- a/src/Backends/Audio/miniaudio.cpp
+++ b/src/Backends/Audio/miniaudio.cpp
@@ -243,11 +243,19 @@
 	ma_mutex_unlock(&mutex);
 }
 
-void AudioBackend_SetOrganyaCallback(void (*callback)(void), unsigned int milliseconds)
+void AudioBackend_SetOrganyaCallback(void (*callback)(void))
 {
 	ma_mutex_lock(&organya_mutex);
 
 	organya_callback = callback;
+
+	ma_mutex_unlock(&organya_mutex);
+}
+
+void AudioBackend_SetOrganyaTimer(unsigned int milliseconds)
+{
+	ma_mutex_lock(&organya_mutex);
+
 	organya_callback_milliseconds = milliseconds;
 
 	ma_mutex_unlock(&organya_mutex);