From 2228c07b4f686d80c5a68a2198b40b2d86f157db Mon Sep 17 00:00:00 2001
From: Cameron Gutman <[EMAIL REDACTED]>
Date: Sat, 15 Feb 2025 19:51:58 -0600
Subject: [PATCH] audio: Fix SDL_GetDefaultAudioInfo() always failing
---
src/sdl2_compat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/sdl2_compat.c b/src/sdl2_compat.c
index 7755e3e..4dc7472 100644
--- a/src/sdl2_compat.c
+++ b/src/sdl2_compat.c
@@ -6320,7 +6320,7 @@ SDL_GetDefaultAudioInfo(char **name, SDL2_AudioSpec *spec2, int iscapture)
return -1;
}
- retval = SDL3_GetAudioDeviceFormat(iscapture ? SDL_AUDIO_DEVICE_DEFAULT_RECORDING : SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, &spec3, NULL);
+ retval = SDL3_GetAudioDeviceFormat(iscapture ? SDL_AUDIO_DEVICE_DEFAULT_RECORDING : SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, &spec3, NULL) ? 0 : -1;
if (retval == 0) {
if (name) {
*name = SDL3_strdup("System default"); /* the default device can change to different physical hardware on-the-fly in SDL3, so we don't provide a name for it. */