• src/doors/termgfx/audio_mgr.c

    From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Tue Jun 30 22:32:03 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/85a351a3d0d739779d4fc9d8
    Modified Files:
    src/doors/termgfx/audio_mgr.c
    Log Message:
    termgfx: atomic audio-cache write + bounded C;L capture

    - The door-side OGG cache write goes through a per-pid temp then rename(), so a
    concurrent render of the same (content-addressed) track by two nodes, or a
    write cut short by a full disk / door exit, always yields a complete file.
    POSIX rename is atomic; Windows removes the target first (its rename won't
    replace an existing one).
    - The C;L capture buffer is bounded (256KB) so an oversized or unterminated
    reply can't grow the buffer without bound.

    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Wed Jul 1 02:20:56 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/3ccf90eda0d43776acde7f9f
    Modified Files:
    src/doors/termgfx/audio_mgr.c
    Log Message:
    termgfx: make async music transcode portable via threadwrap/semwrap

    The worker that renders music (MIDI/MUS -> PCM -> OGG -> C;S upload APC)
    off the game thread was POSIX-only. Move it onto xpdev's cross-platform wrappers so it works in Windows builds too:

    - mutex + thread create: threadwrap (pthread_mutex_* -- native pthreads
    on *nix, Win32 critical sections on Windows; _beginthread)
    - worker wake: a semwrap semaphore (native POSIX sem / Win32 HANDLE)
    in place of the pthread condvar
    - shutdown "join": _beginthread makes a detached thread on every
    platform (no joinable handle), so termgfx_audio_destroy() posts the
    wake semaphore and waits on a worker-set exit flag rather than
    pthread_join (which threadwrap lacks)

    TERMGFX_ASYNC_MUSIC is now always on; the sync fallback remains behind
    the macro for debugging. No behavior change on *nix -- validated end to
    end (create -> submit real SMF -> poll SHIPPED -> destroy joins cleanly;
    idle create/destroy clean) and both doors build clean under GCC -Werror.
    The Windows leg uses the same wrappers the rest of Synchronet relies on
    but is unverified by an MSVC compile here.

    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net