mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-18 00:49:19 +02:00
OpenAL does not re-route on its own, so unplugging the active output device (e.g. headphones) mid-game left the sim silent until restart. Poll ALC_CONNECTED (ALC_EXT_disconnect) at ~1 Hz and, when the device is lost, reopen playback on the current default output via alcReopenDeviceSOFT, preserving the context and all sources. Tokens are declared locally since the bundled AL headers ship no alext.h; the entry point is resolved at runtime, so this is a no-op (with a log warning) on OpenAL Soft builds too old to provide ALC_SOFT_reopen_device.