sdl2-compat: audio: SDL_GetAudioDeviceName() now returns a `const char *`, owned by SDL3.

From 841d8ef67d505683021b245f0d09873a82f1b113 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Mon, 3 Jun 2024 15:22:30 -0400
Subject: [PATCH] audio: SDL_GetAudioDeviceName() now returns a `const char *`,
 owned by SDL3.

---
 src/sdl2_compat.c | 6 ++----
 src/sdl3_syms.h   | 2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/sdl2_compat.c b/src/sdl2_compat.c
index b369b0a..a620ad6 100644
--- a/src/sdl2_compat.c
+++ b/src/sdl2_compat.c
@@ -4801,11 +4801,11 @@ static int GetNumAudioDevices(int iscapture)
         }
 
         for (i = 0; i < num_devices; i++) {
-            char *newname = SDL3_GetAudioDeviceName(devices[i]);
+            const char *newname = SDL3_GetAudioDeviceName(devices[i]);
             char *fullname = NULL;
             if (newname == NULL) {
                 /* ugh, whatever, just make up a name. */
-                newname = SDL3_strdup("Unidentified device");
+                newname = "Unidentified device";
             }
 
             /* Device names must be unique in SDL2, as that's how we open them.
@@ -4818,12 +4818,10 @@ static int GetNumAudioDevices(int iscapture)
                     SDL3_free(newlist.devices[i].name);
                 }
                 SDL3_free(devices);
-                SDL3_free(newname);
                 SDL3_free(fullname);
                 return list->num_devices;  /* just return the existing one for now. Oh well. */
             }
 
-            SDL3_free(newname);
             newlist.devices[i].devid = devices[i];
             newlist.devices[i].name = fullname;
         }
diff --git a/src/sdl3_syms.h b/src/sdl3_syms.h
index 2c29e12..4d0b62a 100644
--- a/src/sdl3_syms.h
+++ b/src/sdl3_syms.h
@@ -798,7 +798,7 @@ SDL3_SYM_PASSTHROUGH(const char*,GetAudioDriver,(int a),(a),return)
 SDL3_SYM_PASSTHROUGH(const char*,GetCurrentAudioDriver,(void),(),return)
 SDL3_SYM(SDL_AudioDeviceID*,GetAudioOutputDevices,(int *a),(a),return)
 SDL3_SYM(SDL_AudioDeviceID*,GetAudioCaptureDevices,(int *a),(a),return)
-SDL3_SYM(char*,GetAudioDeviceName,(SDL_AudioDeviceID a),(a),return)
+SDL3_SYM(const char*,GetAudioDeviceName,(SDL_AudioDeviceID a),(a),return)
 SDL3_SYM(int,GetAudioDeviceFormat,(SDL_AudioDeviceID a, SDL_AudioSpec *b, int *c),(a,b,c),return)
 SDL3_SYM(SDL_AudioDeviceID,OpenAudioDevice,(SDL_AudioDeviceID a, const SDL_AudioSpec *b),(a,b),return)
 SDL3_SYM(void,CloseAudioDevice,(SDL_AudioDeviceID a),(a),)