sdl2-compat: updated after latest SDL3 audio changes.

From 9b485e868765b665f31202011d2b0329486e5750 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Mon, 28 Aug 2023 00:33:50 +0300
Subject: [PATCH] updated after latest SDL3 audio changes.

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

diff --git a/src/sdl2_compat.c b/src/sdl2_compat.c
index 408eb53..8316a8c 100644
--- a/src/sdl2_compat.c
+++ b/src/sdl2_compat.c
@@ -4291,7 +4291,7 @@ SDL_PauseAudioDevice(SDL_AudioDeviceID dev, int pause_on)
 {
     SDL2_AudioStream *stream2 = GetOpenAudioDevice(dev);
     if (stream2) {
-        const SDL_AudioDeviceID device3 = SDL3_GetAudioStreamBinding(stream2->stream3);
+        const SDL_AudioDeviceID device3 = SDL3_GetAudioStreamDevice(stream2->stream3);
         SDL3_ClearAudioStream(stream2->stream3);
         if (device3) {
             if (pause_on) {
@@ -4309,7 +4309,7 @@ SDL_GetAudioDeviceStatus(SDL_AudioDeviceID dev)
     SDL2_AudioStatus retval = SDL2_AUDIO_STOPPED;
     SDL2_AudioStream *stream2 = GetOpenAudioDevice(dev);
     if (stream2) {
-        const SDL_AudioDeviceID device3 = SDL3_GetAudioStreamBinding(stream2->stream3);
+        const SDL_AudioDeviceID device3 = SDL3_GetAudioStreamDevice(stream2->stream3);
         if (device3) {
             retval = SDL3_IsAudioDevicePaused(device3) ? SDL2_AUDIO_PAUSED : SDL2_AUDIO_PLAYING;
         }
@@ -4340,7 +4340,7 @@ SDL_CloseAudioDevice(SDL_AudioDeviceID dev)
 {
     SDL2_AudioStream *stream2 = GetOpenAudioDevice(dev);
     if (stream2) {
-        SDL3_CloseAudioDevice(SDL3_GetAudioStreamBinding(stream2->stream3));
+        SDL3_CloseAudioDevice(SDL3_GetAudioStreamDevice(stream2->stream3));
         SDL_FreeAudioStream(stream2);
         AudioOpenDevices[dev - 1] = NULL;  /* this doesn't hold a lock in SDL2, either; the lock only prevents two racing opens from getting the same id. We can NULL it whenever, though. */
     }
diff --git a/src/sdl3_include_wrapper.h b/src/sdl3_include_wrapper.h
index 20d3564..46920cb 100644
--- a/src/sdl3_include_wrapper.h
+++ b/src/sdl3_include_wrapper.h
@@ -901,7 +901,7 @@
 #define SDL_SetAudioStreamGetCallback IGNORE_THIS_VERSION_OF_SDL_SetAudioStreamGetCallback
 #define SDL_SetAudioStreamPutCallback IGNORE_THIS_VERSION_OF_SDL_SetAudioStreamPutCallback
 #define SDL_DestroyAudioStream IGNORE_THIS_VERSION_OF_SDL_DestroyAudioStream
-#define SDL_CreateAndBindAudioStream IGNORE_THIS_VERSION_OF_SDL_CreateAndBindAudioStream
+#define SDL_OpenAudioDeviceStream IGNORE_THIS_VERSION_OF_SDL_OpenAudioDeviceStream
 #define SDL_LoadWAV_RW IGNORE_THIS_VERSION_OF_SDL_LoadWAV_RW
 #define SDL_LoadWAV IGNORE_THIS_VERSION_OF_SDL_LoadWAV
 #define SDL_MixAudioFormat IGNORE_THIS_VERSION_OF_SDL_MixAudioFormat
@@ -911,7 +911,7 @@
 #define SDL_PauseAudioDevice IGNORE_THIS_VERSION_OF_SDL_PauseAudioDevice
 #define SDL_ResumeAudioDevice IGNORE_THIS_VERSION_OF_SDL_ResumeAudioDevice
 #define SDL_IsAudioDevicePaused IGNORE_THIS_VERSION_OF_SDL_IsAudioDevicePaused
-#define SDL_GetAudioStreamBinding IGNORE_THIS_VERSION_OF_SDL_GetAudioStreamBinding
+#define SDL_GetAudioStreamDevice IGNORE_THIS_VERSION_OF_SDL_GetAudioStreamDevice
 #define SDL_ShowWindowSystemMenu IGNORE_THIS_VERSION_OF_SDL_ShowWindowSystemMenu
 #define SDL_ReadS16LE IGNORE_THIS_VERSION_OF_SDL_ReadS16LE
 #define SDL_ReadS16BE IGNORE_THIS_VERSION_OF_SDL_ReadS16BE
@@ -4447,8 +4447,8 @@
 #undef SDL_DestroyAudioStream
 #endif
 
-#ifdef SDL_CreateAndBindAudioStream
-#undef SDL_CreateAndBindAudioStream
+#ifdef SDL_OpenAudioDeviceStream
+#undef SDL_OpenAudioDeviceStream
 #endif
 
 #ifdef SDL_LoadWAV_RW
@@ -4487,8 +4487,8 @@
 #undef SDL_IsAudioDevicePaused
 #endif
 
-#ifdef SDL_GetAudioStreamBinding
-#undef SDL_GetAudioStreamBinding
+#ifdef SDL_GetAudioStreamDevice
+#undef SDL_GetAudioStreamDevice
 #endif
 
 #ifdef SDL_ShowWindowSystemMenu
diff --git a/src/sdl3_syms.h b/src/sdl3_syms.h
index ba2eaff..66d8eae 100644
--- a/src/sdl3_syms.h
+++ b/src/sdl3_syms.h
@@ -899,7 +899,7 @@ SDL3_SYM(int,GetSilenceValueForFormat,(SDL_AudioFormat a),(a),return)
 SDL3_SYM(int,PauseAudioDevice,(SDL_AudioDeviceID a),(a),return)
 SDL3_SYM(int,ResumeAudioDevice,(SDL_AudioDeviceID a),(a),return)
 SDL3_SYM(SDL_bool,IsAudioDevicePaused,(SDL_AudioDeviceID a),(a),return)
-SDL3_SYM(SDL_AudioDeviceID,GetAudioStreamBinding,(SDL_AudioStream *a),(a),return)
+SDL3_SYM(SDL_AudioDeviceID,GetAudioStreamDevice,(SDL_AudioStream *a),(a),return)
 #if defined(__GDK__)
 SDL3_SYM_PASSTHROUGH(int,GDKGetDefaultUser,(XUserHandle *a),(a),return)
 #endif