SDL: audio: Don't use SDL_BindAudioStream inside SDL_OpenAudioDeviceStream().

From 5e1d9d19a4455fd5d0b7f16a6399f812ba691edb Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Tue, 13 Feb 2024 15:23:27 -0500
Subject: [PATCH] audio: Don't use SDL_BindAudioStream inside
 SDL_OpenAudioDeviceStream().

It has a lot of complex validation and locking we want to avoid here.
---
 src/audio/SDL_audio.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c
index 6a1c4aa0e861..d9cd713880af 100644
--- a/src/audio/SDL_audio.c
+++ b/src/audio/SDL_audio.c
@@ -1945,12 +1945,18 @@ SDL_AudioStream *SDL_OpenAudioDeviceStream(SDL_AudioDeviceID devid, const SDL_Au
             stream = SDL_CreateAudioStream(spec, &device->spec);
         }
 
-        if (!stream || (SDL_BindAudioStream(logdevid, stream) == -1)) {
+        if (!stream) {
             failed = SDL_TRUE;
         } else {
+            // don't do all the complicated validation and locking of SDL_BindAudioStream just to set a few fields here.
+            logdev->bound_streams = stream;
             logdev->simplified = SDL_TRUE;  // forbid further binding changes on this logical device.
+
+            stream->bound_device = logdev;
             stream->simplified = SDL_TRUE;  // so we know to close the audio device when this is destroyed.
 
+            UpdateAudioStreamFormatsPhysical(device);
+
             if (callback) {
                 int rc;
                 if (iscapture) {