From f48cb716c2ba22bf6866d9e774c39997d3c668b2 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Sat, 24 Jun 2023 14:56:54 -0400
Subject: [PATCH] pulseaudio: a couple minor tweaks.
---
src/audio/pulseaudio/SDL_pulseaudio.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/audio/pulseaudio/SDL_pulseaudio.c b/src/audio/pulseaudio/SDL_pulseaudio.c
index fcd9d15ecfb1..7585345fe7ff 100644
--- a/src/audio/pulseaudio/SDL_pulseaudio.c
+++ b/src/audio/pulseaudio/SDL_pulseaudio.c
@@ -533,6 +533,7 @@ static void PULSEAUDIO_CloseDevice(SDL_AudioDevice *device)
PULSEAUDIO_pa_stream_disconnect(device->hidden->stream);
PULSEAUDIO_pa_stream_unref(device->hidden->stream);
}
+ PULSEAUDIO_pa_threaded_mainloop_signal(pulseaudio_threaded_mainloop, 0); // in case the device thread is waiting somewhere, this will unblock it.
PULSEAUDIO_pa_threaded_mainloop_unlock(pulseaudio_threaded_mainloop);
SDL_free(device->hidden->mixbuf);
@@ -560,10 +561,7 @@ static void SourceDeviceNameCallback(pa_context *c, const pa_source_info *i, int
static SDL_bool FindDeviceName(struct SDL_PrivateAudioData *h, const SDL_bool iscapture, void *handle)
{
- if (handle == NULL) { /* NULL == default device. */
- return SDL_TRUE;
- }
-
+ SDL_assert(handle != NULL); // this was a thing in SDL2, but shouldn't be in SDL3.
const uint32_t idx = ((uint32_t)((intptr_t)handle)) - 1;
if (iscapture) {