From 8ee7dc2f9fa0bc5fceaa8163ab6087396a8be718 Mon Sep 17 00:00:00 2001
From: William Horvath <[EMAIL REDACTED]>
Date: Sat, 7 Feb 2026 22:06:14 -0800
Subject: [PATCH] dummyaudio: Remove bitrotted support for
__EMSCRIPTEN_PTHREADS__ code path.
In SDL_audio.c:OpenPhysicalAudioDevice, an attempt is made to SDL_CreateThread
if ProvidesOwnCallbackThread is false, but SDL_CreateThreadWithPropertiesRuntime
is not implemented for Emscripten, so this always fails. I'm not sure if/when
this ever worked, but it simply cannot work in its current state.
---
src/audio/dummy/SDL_dummyaudio.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/audio/dummy/SDL_dummyaudio.c b/src/audio/dummy/SDL_dummyaudio.c
index b325acb7fb75e..74a628bcaeb97 100644
--- a/src/audio/dummy/SDL_dummyaudio.c
+++ b/src/audio/dummy/SDL_dummyaudio.c
@@ -25,7 +25,7 @@
#include "../SDL_sysaudio.h"
#include "SDL_dummyaudio.h"
-#if defined(SDL_PLATFORM_EMSCRIPTEN) && !defined(__EMSCRIPTEN_PTHREADS__)
+#if defined(SDL_PLATFORM_EMSCRIPTEN)
#include <emscripten/emscripten.h>
#endif
@@ -59,8 +59,8 @@ static bool DUMMYAUDIO_OpenDevice(SDL_AudioDevice *device)
}
}
- // on Emscripten without threads, we just fire a repeating timer to consume audio.
- #if defined(SDL_PLATFORM_EMSCRIPTEN) && !defined(__EMSCRIPTEN_PTHREADS__)
+ // on Emscripten, we just fire a repeating timer to consume audio.
+ #if defined(SDL_PLATFORM_EMSCRIPTEN)
MAIN_THREAD_EM_ASM({
var a = Module['SDL3'].dummy_audio;
if (a.timers[$0] !== undefined) { clearInterval(a.timers[$0]); }
@@ -74,8 +74,8 @@ static bool DUMMYAUDIO_OpenDevice(SDL_AudioDevice *device)
static void DUMMYAUDIO_CloseDevice(SDL_AudioDevice *device)
{
if (device->hidden) {
- // on Emscripten without threads, we just fire a repeating timer to consume audio.
- #if defined(SDL_PLATFORM_EMSCRIPTEN) && !defined(__EMSCRIPTEN_PTHREADS__)
+ // on Emscripten, we just fire a repeating timer to consume audio.
+ #if defined(SDL_PLATFORM_EMSCRIPTEN)
MAIN_THREAD_EM_ASM({
var a = Module['SDL3'].dummy_audio;
if (a.timers[$0] !== undefined) { clearInterval(a.timers[$0]); }
@@ -113,8 +113,8 @@ static bool DUMMYAUDIO_Init(SDL_AudioDriverImpl *impl)
impl->OnlyHasDefaultRecordingDevice = true;
impl->HasRecordingSupport = true;
- // on Emscripten without threads, we just fire a repeating timer to consume audio.
- #if defined(SDL_PLATFORM_EMSCRIPTEN) && !defined(__EMSCRIPTEN_PTHREADS__)
+ // on Emscripten, we just fire a repeating timer to consume audio.
+ #if defined(SDL_PLATFORM_EMSCRIPTEN)
MAIN_THREAD_EM_ASM({
Module['SDL3'].dummy_audio = {};
Module['SDL3'].dummy_audio.timers = [];