SDL: audio: Fixed adding new physical devices to a double-linked list.

From cdd2ba81decd387e0015a4ba83e0a6d2ca18e23d Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Fri, 23 Jun 2023 21:42:48 -0400
Subject: [PATCH] audio: Fixed adding new physical devices to a double-linked
 list.

(Forgot to hook up existing node's `prev` field when adding the new device
to the head of the list. Doh.)
---
 src/audio/SDL_audio.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c
index 6cb683433f19..6b8099c4e75b 100644
--- a/src/audio/SDL_audio.c
+++ b/src/audio/SDL_audio.c
@@ -246,6 +246,11 @@ static SDL_AudioDevice *CreatePhysicalAudioDevice(const char *name, SDL_bool isc
     device->instance_id = assign_audio_device_instance_id(iscapture, /*islogical=*/SDL_FALSE);
 
     SDL_LockRWLockForWriting(current_audio.device_list_lock);
+
+    if (*devices) {
+        SDL_assert((*devices)->prev == NULL);
+        (*devices)->prev = device;
+    }
     device->next = *devices;
     *devices = device;
     SDL_AtomicIncRef(device_count);