emscripten: Proxy Emscripten_GetSystemTheme and EMSCRIPTENAUDIO_OpenDevice to the main thread.
(cherry picked from commit 168d1a9253)
This commit is contained in:
1 parent
28c71368a1
commit
0b0b02c5a1
2 files changed
+2
-2
No files matched your search
@@ -189,7 +189,7 @@ static bool EMSCRIPTENAUDIO_OpenDevice(SDL_AudioDevice *device)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// limit to native freq
|
// limit to native freq
|
||||||
device->spec.freq = EM_ASM_INT({ return Module['SDL3'].audioContext.sampleRate; });
|
device->spec.freq = MAIN_THREAD_EM_ASM_INT({ return Module['SDL3'].audioContext.sampleRate; });
|
||||||
device->sample_frames = SDL_GetDefaultSampleFramesFromFreq(device->spec.freq) * 2; // double the buffer size, some browsers need more, and we'll just have to live with the latency.
|
device->sample_frames = SDL_GetDefaultSampleFramesFromFreq(device->spec.freq) * 2; // double the buffer size, some browsers need more, and we'll just have to live with the latency.
|
||||||
|
|
||||||
SDL_UpdatedAudioDeviceFormat(device);
|
SDL_UpdatedAudioDeviceFormat(device);
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ static SDL_SystemTheme Emscripten_GetSystemTheme(void)
|
|||||||
/* Technically, light theme can mean explicit light theme or no preference.
|
/* Technically, light theme can mean explicit light theme or no preference.
|
||||||
https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme#syntax */
|
https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme#syntax */
|
||||||
|
|
||||||
int theme_code = EM_ASM_INT({
|
int theme_code = MAIN_THREAD_EM_ASM_INT({
|
||||||
if (!window.matchMedia) {
|
if (!window.matchMedia) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user