From 6fcfcc3d6fc520d0f5d3c6a6e0fe04d8aeb6d3aa Mon Sep 17 00:00:00 2001 From: pionere Date: Mon, 17 Jan 2022 11:00:03 +0100 Subject: [PATCH] get rid of SkipMixerLock --- src/audio/SDL_audio.c | 15 +-------------- src/audio/SDL_sysaudio.h | 1 - src/audio/emscripten/SDL_emscriptenaudio.c | 7 ++++++- src/audio/qsa/SDL_qsa_audio.c | 1 - 4 files changed, 7 insertions(+), 17 deletions(-) diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index 849416c83..3514ca3b7 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -334,11 +334,6 @@ SDL_AudioUnlockDevice_Default(SDL_AudioDevice * device) } } -static void -SDL_AudioLockOrUnlockDeviceWithNoMixerLock(SDL_AudioDevice * device) -{ -} - static void finish_audio_entry_points_init(void) { @@ -347,14 +342,6 @@ finish_audio_entry_points_init(void) * blindly call them without having to check for validity first. */ - if (current_audio.impl.SkipMixerLock) { - if (current_audio.impl.LockDevice == NULL) { - current_audio.impl.LockDevice = SDL_AudioLockOrUnlockDeviceWithNoMixerLock; - } - if (current_audio.impl.UnlockDevice == NULL) { - current_audio.impl.UnlockDevice = SDL_AudioLockOrUnlockDeviceWithNoMixerLock; - } - } #define FILL_STUB(x) \ if (current_audio.impl.x == NULL) { \ @@ -1421,7 +1408,7 @@ open_audio_device(const char *devname, int iscapture, SDL_AtomicSet(&device->enabled, 1); /* Create a mutex for locking the sound buffers */ - if (!current_audio.impl.SkipMixerLock) { + if (current_audio.impl.LockDevice == SDL_AudioLockDevice_Default) { device->mixer_lock = SDL_CreateMutex(); if (device->mixer_lock == NULL) { close_audio_device(device); diff --git a/src/audio/SDL_sysaudio.h b/src/audio/SDL_sysaudio.h index 6c602f07b..7d90a87ef 100644 --- a/src/audio/SDL_sysaudio.h +++ b/src/audio/SDL_sysaudio.h @@ -86,7 +86,6 @@ typedef struct SDL_AudioDriverImpl /* Some flags to push duplicate code into the core and reduce #ifdefs. */ /* !!! FIXME: these should be SDL_bool */ int ProvidesOwnCallbackThread; - int SkipMixerLock; int HasCaptureSupport; int OnlyHasDefaultOutputDevice; int OnlyHasDefaultCaptureDevice; diff --git a/src/audio/emscripten/SDL_emscriptenaudio.c b/src/audio/emscripten/SDL_emscriptenaudio.c index c85d8d0fc..0849ff86a 100644 --- a/src/audio/emscripten/SDL_emscriptenaudio.c +++ b/src/audio/emscripten/SDL_emscriptenaudio.c @@ -339,6 +339,11 @@ EMSCRIPTENAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscaptu return 0; } +static void +EMSCRIPTENAUDIO_LockOrUnlockDeviceWithNoMixerLock(SDL_AudioDevice * device) +{ +} + static int EMSCRIPTENAUDIO_Init(SDL_AudioDriverImpl * impl) { @@ -352,7 +357,7 @@ EMSCRIPTENAUDIO_Init(SDL_AudioDriverImpl * impl) impl->OnlyHasDefaultOutputDevice = 1; /* no threads here */ - impl->SkipMixerLock = 1; + impl->LockDevice = impl->UnlockDevice = EMSCRIPTENAUDIO_LockOrUnlockDeviceWithNoMixerLock; impl->ProvidesOwnCallbackThread = 1; /* check availability */ diff --git a/src/audio/qsa/SDL_qsa_audio.c b/src/audio/qsa/SDL_qsa_audio.c index ca1539fdd..106d9f89f 100644 --- a/src/audio/qsa/SDL_qsa_audio.c +++ b/src/audio/qsa/SDL_qsa_audio.c @@ -659,7 +659,6 @@ QSA_Init(SDL_AudioDriverImpl * impl) impl->UnlockDevice = NULL; impl->ProvidesOwnCallbackThread = 0; - impl->SkipMixerLock = 0; impl->HasCaptureSupport = 1; impl->OnlyHasDefaultOutputDevice = 0; impl->OnlyHasDefaultCaptureDevice = 0;