pulseaudio: a couple minor tweaks.

main
Ryan C. Gordon 2023-06-24 14:56:54 -04:00
parent dac25fe9eb
commit f48cb716c2
No known key found for this signature in database
GPG Key ID: FA148B892AB48044
1 changed files with 2 additions and 4 deletions

View File

@ -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) {