From 0d5cad91b1007e53a98cdc2fcf767d783fc24490 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 11 Oct 2023 15:10:09 -0700
Subject: [PATCH] We need audio converters initialized in SDL_InitAudio()
These are used separately from audio streams, e.g. SDL_OutputAudioThreadIterate(), so they should always be initialized when audio is initialized.
---
src/audio/SDL_audio.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c
index d974ea4cefd1..112cb20e2187 100644
--- a/src/audio/SDL_audio.c
+++ b/src/audio/SDL_audio.c
@@ -602,6 +602,9 @@ int SDL_InitAudio(const char *driver_name)
SDL_QuitAudio(); // shutdown driver if already running.
}
+ SDL_ChooseAudioConverters();
+ SDL_SetupAudioResampler();
+
SDL_RWLock *device_list_lock = SDL_CreateRWLock(); // create this early, so if it fails we don't have to tear down the whole audio subsystem.
if (!device_list_lock) {
return -1;