SDL/src
Ryan C. Gordon a17f3ba916
audio: Reworked audio device disconnect management.
- No more tapdance to either join the audio device thread or have it detach
itself. Significant simplication of and fixes to the locking code to prevent
deadlocks.
- Physical devices now keep a refcount. Each logical device increments it,
as does the existence of a device thread, etc. Last unref destroys the
device and takes it out of the device_hash. Since there's a lot of moving
parts that might be holding a reference to a physical device, this seemed
like a safer way to protect the object.
- Disconnected devices now continue to function as zombie devices. Playback
devices will still consume data (and just throw it away), and capture devices
will continue to produce data (which always be silence). This helps apps
that don't handle disconnect events; the device still stops playing/capturing,
but bound audio streams will still consume data so they don't allocate more
data infinitely, and apps that depend on an audio callback firing regularly
to make progress won't hang.

Please note that disconnected audio devices must now be explicitly closed!
They always _should_ have been, but before this commit, SDL3 would destroy the
disconnected device for you (and manually closing afterwards was a safe no-op).

Reference Issue #8331.
Fixes #8386.

(and probably others).
2023-10-16 10:04:02 -04:00
..
atomic Fix remaining typos (#7921) 2023-07-03 12:46:47 -07:00
audio audio: Reworked audio device disconnect management. 2023-10-16 10:04:02 -04:00
core Always provide an implementation for all SDL3 symbols 2023-10-12 14:00:47 +02:00
cpuinfo Fix some issues caught by check_stdlib_usage.py 2023-06-27 06:19:06 -07:00
dynapi Add unsupported functions to dynapi 2023-10-12 14:00:47 +02:00
events events: Log file drop position events and print the pointer coordinates 2023-09-20 15:00:40 -04:00
file Added properties to various SDL objects 2023-10-11 22:38:00 -07:00
filesystem gdk: GetBasePath should be a UTF8 version of Win32 GetBasePath 2023-08-25 10:47:16 -04:00
haptic Updated source to match SDL function prototype style 2023-05-23 11:29:41 -07:00
hidapi Fixed crash in hid_init() if the HIDDeviceManager isn't available 2023-09-22 10:14:16 -07:00
joystick Added properties to various SDL objects 2023-10-11 22:38:00 -07:00
libm libm: use union for infinity 2023-09-25 18:02:40 +02:00
loadso Fix uses of undefined macro identifiers (-Wundef) 2023-03-29 21:49:01 +00:00
locale Updated source to match SDL function prototype style 2023-05-23 11:29:41 -07:00
main/winrt Remove SDL3_main from build systems, remove most of src/main/* 2022-12-15 08:01:01 -08:00
misc Implement visionOS support 2023-08-08 22:25:04 -07:00
power linux: Handle upower's UP_DEVICE_STATE_PENDING_CHARGE, PENDING_DISCHARGE 2023-09-20 08:32:03 -07:00
render Always provide an implementation for all SDL3 symbols 2023-10-12 14:00:47 +02:00
sensor Added properties to various SDL objects 2023-10-11 22:38:00 -07:00
stdlib SDL_iconv_string() defaults to UTF-8 2023-09-24 17:27:23 -07:00
test test: Extract SDLTest_ReadSurfacePixel 2023-10-10 03:23:20 -07:00
thread Like mutexes, operations on NULL rwlocks are no-ops 2023-10-11 09:49:44 -07:00
timer SDL API renaming: SDL TLS functions 2023-05-26 08:33:15 -07:00
video wayland: Fix primary selection handling when the protocol isn't supported 2023-10-12 12:32:27 -04:00
SDL.c Added SDL properties API 2023-10-11 22:38:00 -07:00
SDL_assert.c emscripten: Restore compatibility with existing emsdk releases. 2023-09-20 14:32:41 -04:00
SDL_assert_c.h Updated copyright for 2023 2023-01-09 09:41:41 -08:00
SDL_error.c Updated source to match SDL function prototype style 2023-05-23 11:29:41 -07:00
SDL_error_c.h Updated copyright for 2023 2023-01-09 09:41:41 -08:00
SDL_guid.c Add error returns to void functions that can fail/set errors. 2023-02-09 07:23:21 -08:00
SDL_hashtable.c hashtable: Moved over to single-line comments. 2023-10-15 15:41:04 -04:00
SDL_hashtable.h hashtable: SDL_IterateHashTable might as well provide both key and value. 2023-10-14 13:23:03 -04:00
SDL_hints.c Set the hint value before calling hint callbacks 2023-06-28 08:53:48 -07:00
SDL_hints_c.h For gamepads that don't have their own sensors, try to use the system sensors. 2023-06-16 14:44:59 -07:00
SDL_internal.h Rename SDL mutex, semaphore and condition variable types to match SDL 3.0 naming convention 2023-04-28 12:08:33 -07:00
SDL_list.c Updated copyright for 2023 2023-01-09 09:41:41 -08:00
SDL_list.h Updated copyright for 2023 2023-01-09 09:41:41 -08:00
SDL_log.c Updated source to match SDL function prototype style 2023-05-23 11:29:41 -07:00
SDL_log_c.h Updated copyright for 2023 2023-01-09 09:41:41 -08:00
SDL_properties.c Fixed potential wraparound issue with property IDs 2023-10-12 06:22:34 -07:00
SDL_properties_c.h Added SDL properties API 2023-10-11 22:38:00 -07:00
SDL_utils.c Improve sensor detection for Linux gamepad 2023-06-26 07:32:40 -07:00
SDL_utils_c.h Improve sensor detection for Linux gamepad 2023-06-26 07:32:40 -07:00