get rid of SkipMixerLock
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c
index 849416c..3514ca3 100644
--- a/src/audio/SDL_audio.c
+++ b/src/audio/SDL_audio.c
@@ -335,11 +335,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 6c602f0..7d90a87 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 c85d8d0..0849ff8 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 ca1539f..106d9f8 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;