From 862d214caa63f4be17e72101fac6549404a19a0a Mon Sep 17 00:00:00 2001 From: Stian Skjelstad Date: Mon, 11 Nov 2024 21:24:05 +0100 Subject: [PATCH] [MacOS: CoreAudio] Add missing mutex locking in two API functions. --- devp/devpcoreaudio.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/devp/devpcoreaudio.c b/devp/devpcoreaudio.c index 3f60b61c..a669d7cb 100644 --- a/devp/devpcoreaudio.c +++ b/devp/devpcoreaudio.c @@ -343,7 +343,6 @@ static void devpCoreAudioOnBufferCallback (int samplesuntil, void (*callback)(vo debug_printf ("devpCoreAudioOnBufferCallback: EXIT\n"); } - static void devpCoreAudioCommitBuffer (unsigned int samples) { debug_printf ("devpCoreAudioCommitBuffer: ENTER\n"); @@ -479,7 +478,11 @@ static int devpCoreAudioPlay (uint32_t *rate, enum plrRequestFormat *format, str static void devpCoreAudioGetStats (uint64_t *committed, uint64_t *processed) { + pthread_mutex_lock(&mutex); + plrDriverAPI->ringbufferAPI->get_stats (devpCoreAudioRingBuffer, committed, processed); + + pthread_mutex_unlock(&mutex); } static const struct plrDevAPI_t devpCoreAudio = {