Simple DirectMedia Layer https://libsdl.org
Find a file
Ryan C. Gordon 6136358840
audio: Split device "zombie" status into multiple stages.
Otherwise, a device that is disconnected in the standard audio device thread
might keep failing WaitDevice() in a tight loop, each one generating a new
main thread callback. In normal situations, this is wasteful, but if the
app isn't pumping the event loop quickly (or at all!), this will quickly eat
up all the memory in a machine.

Now we note that the device is zombified right away, and device thread
iteration will use this to replace the implementation with the Zombie
equivalents once it owns the device lock.

The main thread callback will progress to device->zombie==2, which it uses to
decide if this is a duplicate disconnect notification. Since it also owns the
lock at this point, it takes the moment to set the Zombie implementation up,
too.

This allows things (like the WASAPI backend) to check for a non-zero zombie
state immediately without having to worry if the main thread callback ran, and
for the standard audio threads to also move to the Zombie implementation
without waiting on that callback.

(The Zombie implementation is used to make a dead device keep processing, so
things that need the audio device to make progress to function will keep
working, and things blindly pushing to an audio stream won't queue up endless
data that isn't being consumed.)

Fixes #15745.
2026-06-09 20:25:49 -04:00
.github ci: ignore artifact upload errors 2026-06-05 03:17:42 +02:00
android-project android: fixed crash adding joysticks before joysticks are initialized 2026-06-08 14:35:42 -07:00
build-scripts stdlib: Add SDL_wcstoul(), SDL_wcstoll(), and SDL_wcstoull() 2026-06-08 11:58:47 -04:00
cmake dos: Fixed some mistakes in cmake/PreseedDOSCache.cmake 2026-06-09 00:54:46 -04:00
docs SDL_GetRenderOutputSize -> SDL_GetCurrentRenderOutputSIze 2026-06-06 07:57:24 -07:00
examples examples/input/05-gamepad-rumble: add some visual feedback. 2026-06-02 19:50:05 -04:00
include Sync SDL3 wiki -> header 2026-06-08 16:02:29 +00:00
src audio: Split device "zombie" status into multiple stages. 2026-06-09 20:25:49 -04:00
test stdlib: Add SDL_wcstoul(), SDL_wcstoll(), and SDL_wcstoull() 2026-06-08 11:58:47 -04:00
VisualC examples: Added input/05-gamepad-rumble 2026-05-31 08:32:44 -07:00
VisualC-GDK gdk: Update Suspend/Resume best practices. 2026-03-07 11:19:09 -05:00
wayland-protocols revert parts of CodeSpell commit d870911202 from 3rd party sources 2026-05-13 18:00:02 +03:00
Xcode Added curved window mode on visionOS 26 (#15298) 2026-05-12 16:48:06 -07:00
.clang-format Add CHECK_PARAM as a conditional macro in clang-format 2026-04-03 11:47:41 -04:00
.clang-tidy
.editorconfig
.gitignore Updated .gitignore for png test data 2025-10-10 08:59:27 -07:00
.wikiheaders-options wikiheaders: Generate a current list of supported environment variables. 2025-09-02 15:49:52 -04:00
AGENTS.md AGENTS.md: Change "may not" to "must not". 2026-04-15 17:26:54 -04:00
Android.mk Add SVE2 SIMD Alpha-Blending Blitter (#15504) 2026-05-13 23:37:46 -07:00
BUGS.txt Added a Discord link to BUGS.txt 2025-01-13 16:42:50 -08:00
CLAUDE.md CLAUDE.md: Just copy the text from AGENTS.md in here for now. 2026-04-16 13:51:49 -04:00
CMakeLists.txt stdlib: Add SDL_wcstoul(), SDL_wcstoll(), and SDL_wcstoull() 2026-06-08 11:58:47 -04:00
CREDITS.md Updated the credits for SDL 3.0 2025-01-13 16:42:50 -08:00
INSTALL.md Add a link to docs/INTRO-mingw.md 2025-03-06 16:25:17 -08:00
LICENSE.txt Updated copyright for 2026 2026-01-01 09:40:08 -08:00
README.md Revert "Update README.md" 2025-11-16 01:15:10 +03:00
WhatsNew.txt Added SDL_HINT_MOUSE_DPI_SCALE_CURSORS 2025-12-09 17:12:08 -08:00

Simple DirectMedia Layer (SDL for short) is a cross-platform library designed to make it easy to write multi-media software, such as games and emulators.

You can find the latest release and additional information at: https://www.libsdl.org/

Installation instructions and a quick introduction is available in INSTALL.md

This library is distributed under the terms of the zlib license, available in LICENSE.txt.

Enjoy!

Sam Lantinga (slouken@libsdl.org)