Text chat 64: fluxer-media-playback crate: demux, decode, A/V sync, seeking (#404) #460

Manually merged
charles merged 8 commits from textchat-64-media-playback-crate into textchat 2026-11-13 16:12:24 +00:00
Owner

What this builds

  • fluxer-video: VideoKey::Media { id: u64 } (first commit, media_key_is_distinct_from_other_keys).
  • New crate crates/fluxer-media-playback (spec §19.2/§19.3), with the Interfaces of plan Task 64: ByteSource + MemorySource, a custom AVIOContext (read/seek, AVSEEK_SIZE from len, 64 KiB, no FFmpeg protocol), AudioOut, VideoOut, OpenOptions, HwPreference/HwKind, Player::{open, play, pause, seek, set_looping, set_rate} + Drop (joins within 200 ms; detaches only a thread stuck inside read_at), PlayerEvent, MediaInfo, PlaybackError (no URL in any string; I/O errors keep only their kind), ffmpeg_info(), hardware_decoders(), MAX_PLAYERS = 8.
  • Rules as specified: hardware decode in plan order with a once-only software reopen at the current position on a mid-stream error; I420 within max_size keeping aspect; BT.601 limited output; audio to 48 kHz stereo i16 through atempo when rate != 1; audio master clock, else a monotonic clock that stops while paused (injectable with feature testing: clock::ManualTime, Player::open_with_time); publish at <= clock + 10 ms, drop at < clock - 40 ms, at most 2 held frames; demuxer stops at 2 s of queued audio or 32 video packets; exact seek (keyframe, discard to target, AudioOut::flush, Position(target)); looping without Ended; Buffering(true) after a 250 ms blocked read.
  • tests/support/clips.rs make_clip(ClipSpec { width, height, fps, frames, gop, audio_hz }): TestPattern frames + a tone, MPEG-4 Part 2 + AAC in MP4, in memory with the bundled LGPL encoders (plus faststart and a flat-colour clip). Fixtures h264_aac_64x64.mp4 (7.9 KB), vp9_opus_64x64.webm (6.6 KB), av1_64x64.webm (2.7 KB) made by tools/ffmpeg/make-fixtures.sh.

How it was tested

  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci green locally (Linux, CachyOS, clang 23).
  • All Step 1 tests: tests/player.rs (19), tests/decode.rs (4), unit tests (clock, source, fit, atempo).
  • Hardware: FLUXER_HW_DECODER_TESTS=1 cargo test -p fluxer-media-playback --test hw ran vaapi_decodes_h264_fixture on this desktop (VAAPI) and passed. d3d11va_decodes_h264_fixture was not run (no Windows machine here). CI does not depend on either.
  • Windows was not built locally: the Windows runner is the first build of rusty_ffmpeg against the MSVC import libraries (FFMPEG_DLL_PATH), and it needs libclang for bindgen (the FFmpeg archive ships no pre-generated binding.rs). Please watch that job.

Deviations from the plan

  • Vendored rsmpeg 0.18.0 and rusty_ffmpeg 0.16.7 under third_party/ ([patch.crates-io], same layout as livekit/, PATCHES.md in each, third_party/README.md updated), outside the task's Files list, because neither published crate builds here:
    1. the bundled FFmpeg is --disable-avdevice (Task 63's flags) but rusty_ffmpeg links/binds libavdevice unconditionally and rsmpeg has an avdevice module, so both drop it;
    2. rusty_ffmpeg asks for bindgen 0.71, which with libclang >= 22 makes AVFormatContext & co. opaque; it now uses bindgen 0.72.1, already in the graph for pipewire (so the lockfile gains no second bindgen).
      Follow-up #458 tracks dropping the patch (FFmpeg r2 with an empty avdevice, or upstream). New crates in the graph via rsmpeg: bon, darling 0.24, camino, prettyplease, paste (cargo deny green).
  • Truncated input: a moov-at-end MP4 cut short is Error(Open); a faststart MP4 cut short plays what it has and may end with Ended (the demuxer sees a clean EOF). The test accepts either for that case.
  • BT.709/BT.2020 sources are converted through BGRA and then fluxer_video::convert::bgra_to_i420 (libyuv-exact BT.601 limited), not by swscale alone, so the result matches the shader exactly; BT.601 sources go straight to I420. Costs a second pass on HD video.
  • Ended leaves the player paused at the end (browser behaviour); play restarts from 0, a seek shows that frame.
  • tests/support/mod.rs (harness, fake AudioOut, counting/slow sources) was added next to clips.rs; tests that open players run one at a time per binary because MAX_PLAYERS is process-wide.
  • Process: the tests and the implementation were drafted together before the first compile; the first run failed 2 tests (frame lost at the end of clips: the generator wrote zero packet durations, so the MP4 edit list cut the last frame; and EAGAIN on send_packet dropping a packet), both fixed.

Stacked on: textchat-63-ffmpeg-lgpl-packaging

Closes #404

🤖 Generated with Claude Code

## What this builds - `fluxer-video`: `VideoKey::Media { id: u64 }` (first commit, `media_key_is_distinct_from_other_keys`). - New crate `crates/fluxer-media-playback` (spec §19.2/§19.3), with the Interfaces of plan Task 64: `ByteSource` + `MemorySource`, a custom `AVIOContext` (read/seek, `AVSEEK_SIZE` from `len`, 64 KiB, no FFmpeg protocol), `AudioOut`, `VideoOut`, `OpenOptions`, `HwPreference`/`HwKind`, `Player::{open, play, pause, seek, set_looping, set_rate}` + `Drop` (joins within 200 ms; detaches only a thread stuck inside `read_at`), `PlayerEvent`, `MediaInfo`, `PlaybackError` (no URL in any string; I/O errors keep only their kind), `ffmpeg_info()`, `hardware_decoders()`, `MAX_PLAYERS = 8`. - Rules as specified: hardware decode in plan order with a once-only software reopen at the current position on a mid-stream error; I420 within `max_size` keeping aspect; BT.601 limited output; audio to 48 kHz stereo i16 through `atempo` when rate != 1; audio master clock, else a monotonic clock that stops while paused (injectable with feature `testing`: `clock::ManualTime`, `Player::open_with_time`); publish at <= clock + 10 ms, drop at < clock - 40 ms, at most 2 held frames; demuxer stops at 2 s of queued audio or 32 video packets; exact seek (keyframe, discard to target, `AudioOut::flush`, `Position(target)`); looping without `Ended`; `Buffering(true)` after a 250 ms blocked read. - `tests/support/clips.rs` `make_clip(ClipSpec { width, height, fps, frames, gop, audio_hz })`: TestPattern frames + a tone, MPEG-4 Part 2 + AAC in MP4, in memory with the bundled LGPL encoders (plus `faststart` and a flat-colour clip). Fixtures `h264_aac_64x64.mp4` (7.9 KB), `vp9_opus_64x64.webm` (6.6 KB), `av1_64x64.webm` (2.7 KB) made by `tools/ffmpeg/make-fixtures.sh`. ## How it was tested - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` green locally (Linux, CachyOS, clang 23). - All Step 1 tests: `tests/player.rs` (19), `tests/decode.rs` (4), unit tests (clock, source, fit, atempo). - Hardware: `FLUXER_HW_DECODER_TESTS=1 cargo test -p fluxer-media-playback --test hw` ran **`vaapi_decodes_h264_fixture` on this desktop (VAAPI) and passed**. `d3d11va_decodes_h264_fixture` was not run (no Windows machine here). CI does not depend on either. - Windows was not built locally: the Windows runner is the first build of `rusty_ffmpeg` against the MSVC import libraries (`FFMPEG_DLL_PATH`), and it needs libclang for bindgen (the FFmpeg archive ships no pre-generated `binding.rs`). Please watch that job. ## Deviations from the plan - **Vendored `rsmpeg` 0.18.0 and `rusty_ffmpeg` 0.16.7** under `third_party/` (`[patch.crates-io]`, same layout as `livekit/`, `PATCHES.md` in each, `third_party/README.md` updated), outside the task's Files list, because neither published crate builds here: 1. the bundled FFmpeg is `--disable-avdevice` (Task 63's flags) but `rusty_ffmpeg` links/binds libavdevice unconditionally and `rsmpeg` has an `avdevice` module, so both drop it; 2. `rusty_ffmpeg` asks for bindgen 0.71, which with libclang >= 22 makes `AVFormatContext` & co. opaque; it now uses bindgen 0.72.1, already in the graph for `pipewire` (so the lockfile gains no second bindgen). Follow-up #458 tracks dropping the patch (FFmpeg r2 with an empty avdevice, or upstream). New crates in the graph via rsmpeg: `bon`, `darling 0.24`, `camino`, `prettyplease`, `paste` (cargo deny green). - Truncated input: a moov-at-end MP4 cut short is `Error(Open)`; a faststart MP4 cut short plays what it has and may end with `Ended` (the demuxer sees a clean EOF). The test accepts either for that case. - BT.709/BT.2020 sources are converted through BGRA and then `fluxer_video::convert::bgra_to_i420` (libyuv-exact BT.601 limited), not by `swscale` alone, so the result matches the shader exactly; BT.601 sources go straight to I420. Costs a second pass on HD video. - `Ended` leaves the player paused at the end (browser behaviour); `play` restarts from 0, a seek shows that frame. - `tests/support/mod.rs` (harness, fake `AudioOut`, counting/slow sources) was added next to `clips.rs`; tests that open players run one at a time per binary because `MAX_PLAYERS` is process-wide. - Process: the tests and the implementation were drafted together before the first compile; the first run failed 2 tests (frame lost at the end of clips: the generator wrote zero packet durations, so the MP4 edit list cut the last frame; and EAGAIN on `send_packet` dropping a packet), both fixed. Stacked on: textchat-63-ffmpeg-lgpl-packaging Closes #404 🤖 Generated with [Claude Code](https://claude.com/claude-code)
VideoKey::Media { id } for a playing video attachment, video embed or GIFV.

Refs #404

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The .crate archives from crates.io, unchanged (sha256 5233514…5811 and
f25d40a…3967, the checksums crates.io publishes). The next commit patches
them; see third_party/README.md.

Refs #404

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The bundled FFmpeg is configured with --disable-avdevice; the published crates
link libavdevice and bind its headers unconditionally. rusty_ffmpeg also moves
to the bindgen the workspace already builds (0.71 turns FFmpeg's typedef'd
structs opaque with libclang >= 22). Patched through [patch.crates-io], listed
in each crate's PATCHES.md and third_party/README.md. rsmpeg is pinned with =.

Refs #404

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New crate fluxer-media-playback (Text chat spec §19): a custom AVIOContext over
ByteSource, demux, video decode (VAAPI/NVDEC, D3D11VA/NVDEC, else software;
software fallback mid-stream), conversion to BT.601 limited I420 within
max_size, audio to 48 kHz stereo i16 with atempo, the audio/monotonic clock,
exact seeking, looping, buffering, MAX_PLAYERS = 8, ffmpeg_info() and
hardware_decoders(). Test clips are encoded in memory with the bundled LGPL
encoders; the three vendored fixtures (H.264+AAC, VP9+Opus, AV1, <= 20 KB) are
made by tools/ffmpeg/make-fixtures.sh.

Refs #404

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

Independent review: Text chat 64 (fluxer-media-playback)

Reviewed 978245c..ae3c1f7 cold (the fluxer-video commit, the vendoring commits, the crate).

Checked and fine

  • Step 1 tests: all 25 named tests exist and assert what the plan says (seek_lands_on_the_exact_frame is 30 fps, gop 30, 1.5 s → counter 45; bt709_input_comes_out_bt601_limited is ±2 against libyuv BT.601 limited; ninth_player_is_refused checks the exact Unsupported("too many players"); the hw tests are gated on FLUXER_HW_DECODER_TESTS=1). media_key_is_distinct_from_other_keys is in fluxer-video/src/bus.rs.
  • Interfaces: VideoKey::Media { id: u64 }, ByteSource/MemorySource, AudioOut, VideoOut, OpenOptions (default 1920×1080), HwPreference, HwKind, Player::{open, play, pause, seek, set_looping, set_rate} + Drop, PlayerEvent, MediaInfo, PlaybackError, ffmpeg_info()/FfmpegInfo, hardware_decoders(), MAX_PLAYERS all match the plan exactly. make_clip(ClipSpec { width, height, fps, frames, gop, audio_hz }) matches.
  • Invariants: the crate depends only on rsmpeg, fluxer-video, thiserror and tracing (no fluxer-audio, tokio or reqwest). No change to fluxer-core, fluxer-ui or fluxer-emoji. PlaybackError strings carry only FFmpeg error text or an io::ErrorKind, never a URL. FFmpeg callbacks are wrapped in catch_unwind. Server data cannot reach a panic path: expects are only on checked invariants, and sizes are bounded by max_size. Fixtures are 2.7/6.6/7.9 KB and made by the script.
  • Lock additions: rsmpeg, rusty_ffmpeg, bon, darling, camino, prettyplease. cargo deny is green. The vendoring is documented (PATCHES.md, third_party/README.md, follow-up #458).
  • Local gate: cargo xtask ci in a fresh review worktree: all steps passed (Linux). Media-playback results: 4 unit tests, decode 4/4, player 19/19. hw 1/1: vaapi_decodes_h264_fixture ran and passed on this desktop.

Findings

  1. [blocking] The Windows runner has no way to run rusty_ffmpeg's bindgen.
    • Plan Task 63 says the Windows job must get one of two things: a pre-generated binding.rs reused through FFMPEG_BINDING_PATH (so it needs no libclang), or a pinned LLVM with LIBCLANG_PATH.
    • Neither exists on this branch. tools/ffmpeg/build.sh puts no binding.rs in the win-x64 archive, so xtask ffmpeg env never sets FFMPEG_BINDING_PATH. The windows job in ci.yaml installs git, rustup, cargo-deny and .NET, but no LLVM.
    • This crate is a workspace member and the first Windows consumer of bindgen. cargo test --workspace on the Windows runner will therefore fail in rusty_ffmpeg's build script unless that machine happens to have libclang. The PR itself says Windows was never built.
    • Plan Step 5 requires PASS on both runners.
    • Fix one of two ways: generate binding.rs in the Linux job (or ship it in the archive) and point FFMPEG_BINDING_PATH at it on Windows, or add a pinned LLVM to the Windows bootstrap. If the Windows job turns out green as it stands, downgrade this finding and record why libclang was there.
  2. [minor] A faststart MP4 cut short can end with Ended instead of Error.
    • The plan rule is "corrupt or truncated files end in Error", and truncated_file_is_an_error_not_a_panic accepts either result for this case. There is no panic, but the store will treat a broken file as fully played.
    • The PR discloses this. Fix: compare the reached position with duration at EOF, or open a follow-up issue.
  3. [minor] The audio filter graph does not fix the sink's sample format.
    • Tempo::process reads data[0] as interleaved nb_samples*2 values. It is correct only because format negotiation happens to keep packed s16.
    • An aformat=sample_fmts=s16:channel_layouts=stereo before abuffersink makes that guaranteed. aformat is already in the configure flags.
  4. [minor] MediaInfo.hardware can report a hardware decoder that is not in use.
    • It reports Some(kind) whenever the hardware context opened. When get_format later falls back to a software format, --debug-info/UI still claim hardware.
  5. [minor, note for Task 67] A player opened with autoplay: false shows no frame until play or seek.
    • The tests call seek(Duration::ZERO) to get one. The runtime must do the same if it wants a first frame instead of the poster.
  6. [minor] An audio-only file opened with audio: None ends at once with Ended and no Error.
    • Opened with no AudioOut, it reads to EOF and reports Ended. The store should not open it that way.

Verdict: changes requested. The only blocker is finding 1, the Windows bindgen/libclang path. Everything else matches the plan, and local CI is green.

## Independent review: Text chat 64 (`fluxer-media-playback`) Reviewed `978245c..ae3c1f7` cold (the fluxer-video commit, the vendoring commits, the crate). **Checked and fine** - Step 1 tests: all 25 named tests exist and assert what the plan says (`seek_lands_on_the_exact_frame` is 30 fps, gop 30, 1.5 s → counter 45; `bt709_input_comes_out_bt601_limited` is ±2 against libyuv BT.601 limited; `ninth_player_is_refused` checks the exact `Unsupported("too many players")`; the hw tests are gated on `FLUXER_HW_DECODER_TESTS=1`). `media_key_is_distinct_from_other_keys` is in `fluxer-video/src/bus.rs`. - Interfaces: `VideoKey::Media { id: u64 }`, `ByteSource`/`MemorySource`, `AudioOut`, `VideoOut`, `OpenOptions` (default 1920×1080), `HwPreference`, `HwKind`, `Player::{open, play, pause, seek, set_looping, set_rate}` + `Drop`, `PlayerEvent`, `MediaInfo`, `PlaybackError`, `ffmpeg_info()`/`FfmpegInfo`, `hardware_decoders()`, `MAX_PLAYERS` all match the plan exactly. `make_clip(ClipSpec { width, height, fps, frames, gop, audio_hz })` matches. - Invariants: the crate depends only on `rsmpeg`, `fluxer-video`, `thiserror` and `tracing` (no `fluxer-audio`, `tokio` or `reqwest`). No change to `fluxer-core`, `fluxer-ui` or `fluxer-emoji`. `PlaybackError` strings carry only FFmpeg error text or an `io::ErrorKind`, never a URL. FFmpeg callbacks are wrapped in `catch_unwind`. Server data cannot reach a panic path: `expect`s are only on checked invariants, and sizes are bounded by `max_size`. Fixtures are 2.7/6.6/7.9 KB and made by the script. - Lock additions: `rsmpeg`, `rusty_ffmpeg`, `bon`, `darling`, `camino`, `prettyplease`. `cargo deny` is green. The vendoring is documented (`PATCHES.md`, `third_party/README.md`, follow-up #458). - Local gate: `cargo xtask ci` in a fresh review worktree: **all steps passed** (Linux). Media-playback results: 4 unit tests, decode 4/4, player 19/19. hw 1/1: `vaapi_decodes_h264_fixture` ran and passed on this desktop. **Findings** 1. **[blocking] The Windows runner has no way to run `rusty_ffmpeg`'s bindgen.** - Plan Task 63 says the Windows job must get one of two things: a pre-generated `binding.rs` reused through `FFMPEG_BINDING_PATH` (so it needs no libclang), or a pinned LLVM with `LIBCLANG_PATH`. - Neither exists on this branch. `tools/ffmpeg/build.sh` puts no `binding.rs` in the win-x64 archive, so `xtask ffmpeg env` never sets `FFMPEG_BINDING_PATH`. The `windows` job in `ci.yaml` installs git, rustup, cargo-deny and .NET, but no LLVM. - This crate is a workspace member and the first Windows consumer of bindgen. `cargo test --workspace` on the Windows runner will therefore fail in `rusty_ffmpeg`'s build script unless that machine happens to have libclang. The PR itself says Windows was never built. - Plan Step 5 requires PASS on both runners. - Fix one of two ways: generate `binding.rs` in the Linux job (or ship it in the archive) and point `FFMPEG_BINDING_PATH` at it on Windows, or add a pinned LLVM to the Windows bootstrap. If the Windows job turns out green as it stands, downgrade this finding and record why libclang was there. 2. **[minor] A faststart MP4 cut short can end with `Ended` instead of `Error`.** - The plan rule is "corrupt or truncated files end in `Error`", and `truncated_file_is_an_error_not_a_panic` accepts either result for this case. There is no panic, but the store will treat a broken file as fully played. - The PR discloses this. Fix: compare the reached position with `duration` at EOF, or open a follow-up issue. 3. **[minor] The audio filter graph does not fix the sink's sample format.** - `Tempo::process` reads `data[0]` as interleaved `nb_samples*2` values. It is correct only because format negotiation happens to keep packed s16. - An `aformat=sample_fmts=s16:channel_layouts=stereo` before `abuffersink` makes that guaranteed. `aformat` is already in the configure flags. 4. **[minor] `MediaInfo.hardware` can report a hardware decoder that is not in use.** - It reports `Some(kind)` whenever the hardware context opened. When `get_format` later falls back to a software format, `--debug-info`/UI still claim hardware. 5. **[minor, note for Task 67] A player opened with `autoplay: false` shows no frame until `play` or `seek`.** - The tests call `seek(Duration::ZERO)` to get one. The runtime must do the same if it wants a first frame instead of the poster. 6. **[minor] An audio-only file opened with `audio: None` ends at once with `Ended` and no `Error`.** - Opened with no `AudioOut`, it reads to EOF and reports `Ended`. The store should not open it that way. **Verdict: changes requested.** The only blocker is finding 1, the Windows bindgen/libclang path. Everything else matches the plan, and local CI is green.
rusty_ffmpeg's build script runs bindgen unless FFMPEG_BINDING_PATH is set,
and the Windows runner has no libclang. tools/ffmpeg/gen-binding.sh
generates the bindings of the Windows archive's headers on Linux, for the
MSVC target (int enums, 32-bit long, char* va_list), and type-checks
rusty_ffmpeg for x86_64-pc-windows-msvc. xtask's fetch installs them as
the install's binding.rs, so env sets FFMPEG_BINDING_PATH. rusty_ffmpeg
now reruns when the file it names changes.

Refs #404

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- atempo is followed by aformat (s16, stereo, 48 kHz); frames in any other
  layout are skipped, never read.
- A player opened without autoplay shows its first frame.
- An audio-only file without an AudioOut is Error(Unsupported).
- A file whose index names data past the source's end (a cut faststart
  MP4) ends in Error(Decode) rather than Ended.
- hw_format allows a cast that is a no-op on Windows.

Refs #404

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

Review round 1 (commits d0dba6b, 336aeea): what changed for each finding.

Blocking: the Windows CI cannot run rusty_ffmpeg's bindgen (.forgejo/workflows/ci.yaml): fixed by shipping pre-generated bindings, so the Windows job needs no libclang.

  • tools/ffmpeg/bindings/8.0.3-r1-win-x64.rs holds the bindings of the Windows archive's headers, generated on Linux by the new tools/ffmpeg/gen-binding.sh. The script runs clang for the MSVC target, with the mingw-w64 C headers standing in for the Windows SDK and -fgnuc-version=4.9. That gives 32-bit long, a char * va_list and int enums. rsmpeg relies on the int enums (av_parser_init): a first try with the windows-gnu target produced unsigned enums, and rsmpeg failed to compile against them. The script then type-checks rusty_ffmpeg for x86_64-pc-windows-msvc.
  • cargo xtask ffmpeg fetch (and so ci, env and package, which call it) now installs the committed bindings for the target as the install's binding.rs, copying only when the bytes changed. The existing env_vars then sets FFMPEG_BINDING_PATH. The workflow is unchanged.
  • rusty_ffmpeg patch (PATCHES.md): build.rs now emits cargo:rerun-if-changed=<FFMPEG_BINDING_PATH>. Without it, a regenerated binding at the same path was ignored by a warm target dir, and the Windows runner's target dir persists. I hit this locally.
  • Tests (xtask): install_binding_copies_only_when_it_changed and committed_windows_binding_matches_the_lock. The second checks that the file exists for the locked build, has the Windows va_list and has MSVC int enums. It fails when ffmpeg.lock is bumped without regenerating the file.
  • Verified locally: with the env --target windows variables and no libclang involvement, cargo check and cargo clippy -D warnings of fluxer-media-playback --tests --target x86_64-pc-windows-msvc pass. Clippy flagged one cast that is a no-op only on Windows (hw.rs), now allowed with a comment. Nothing was built or run on the Windows runner itself: linking and the tests there are still unverified until the integrator's run.

Minor: a truncated faststart MP4 ends in Ended (tests/player.rs): fixed, with the test tightened first. At EOF, Demuxer::read now checks the played streams' index entries (avformat_index_get_entry). If any entry points past the source's length, the read gives Error(Decode("the file is cut short")). The test now requires Error(Decode) for the cut faststart file and Ended for the whole one.

Minor: Tempo::process without aformat (audio.rs): fixed. The graph is now abuffer → atempo → aformat(sample_fmts=s16:channel_layouts=stereo:sample_rates=48000) → abuffersink. process also skips any frame that is not 2-channel s16 instead of reading it. New test: tempo_sink_is_pinned_to_interleaved_stereo_s16 (it failed before the fix).

Minor: MediaInfo.hardware reports Some after a software fallback (video.rs): deferred to #464 (follow-up). Opened is sent before anything is decoded. A correct value needs either Opened to wait for the first frame or a new event, which is an interface choice for Task 67's consumer. The field only feeds --debug-info.

Minor: no first frame with autoplay=false; audio-only without AudioOut ends with Ended (player.rs): both fixed, with the tests written first.

  • The video thread now starts in "landing" mode, so a paused player shows its first frame, as <video> does. Task 67 no longer needs seek(0). New test: paused_open_shows_the_first_frame_only (shows frame 0, no more frames while paused, no duplicate after play). seek_lands_on_the_exact_frame now expects [0, 45].
  • An audio-only file opened without an AudioOut is now Error(Unsupported("audio-only media needs an audio output")) before Opened. New test: audio_only_without_an_output_is_an_error, using an in-memory WAV. With an output, the same file opens.

READMEs updated: the crate's, tools/ffmpeg/README.md and xtask/README.md. Local FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci is green.

Review round 1 (commits d0dba6b, 336aeea): what changed for each finding. **Blocking: the Windows CI cannot run rusty_ffmpeg's bindgen** (`.forgejo/workflows/ci.yaml`): fixed by shipping pre-generated bindings, so the Windows job needs no libclang. - `tools/ffmpeg/bindings/8.0.3-r1-win-x64.rs` holds the bindings of the Windows archive's headers, generated on Linux by the new `tools/ffmpeg/gen-binding.sh`. The script runs clang for the **MSVC** target, with the mingw-w64 C headers standing in for the Windows SDK and `-fgnuc-version=4.9`. That gives 32-bit `long`, a `char *` `va_list` and `int` enums. rsmpeg relies on the `int` enums (`av_parser_init`): a first try with the windows-gnu target produced `unsigned` enums, and rsmpeg failed to compile against them. The script then type-checks rusty_ffmpeg for `x86_64-pc-windows-msvc`. - `cargo xtask ffmpeg fetch` (and so `ci`, `env` and `package`, which call it) now installs the committed bindings for the target as the install's `binding.rs`, copying only when the bytes changed. The existing `env_vars` then sets `FFMPEG_BINDING_PATH`. The workflow is unchanged. - rusty_ffmpeg patch (`PATCHES.md`): `build.rs` now emits `cargo:rerun-if-changed=<FFMPEG_BINDING_PATH>`. Without it, a regenerated binding at the same path was ignored by a warm target dir, and the Windows runner's target dir persists. I hit this locally. - Tests (xtask): `install_binding_copies_only_when_it_changed` and `committed_windows_binding_matches_the_lock`. The second checks that the file exists for the locked build, has the Windows `va_list` and has MSVC `int` enums. It fails when `ffmpeg.lock` is bumped without regenerating the file. - Verified locally: with the `env --target windows` variables and no libclang involvement, `cargo check` and `cargo clippy -D warnings` of `fluxer-media-playback --tests --target x86_64-pc-windows-msvc` pass. Clippy flagged one cast that is a no-op only on Windows (`hw.rs`), now allowed with a comment. **Nothing was built or run on the Windows runner itself**: linking and the tests there are still unverified until the integrator's run. **Minor: a truncated faststart MP4 ends in `Ended`** (`tests/player.rs`): fixed, with the test tightened first. At EOF, `Demuxer::read` now checks the played streams' index entries (`avformat_index_get_entry`). If any entry points past the source's length, the read gives `Error(Decode("the file is cut short"))`. The test now requires `Error(Decode)` for the cut faststart file and `Ended` for the whole one. **Minor: `Tempo::process` without `aformat`** (`audio.rs`): fixed. The graph is now `abuffer → atempo → aformat(sample_fmts=s16:channel_layouts=stereo:sample_rates=48000) → abuffersink`. `process` also skips any frame that is not 2-channel s16 instead of reading it. New test: `tempo_sink_is_pinned_to_interleaved_stereo_s16` (it failed before the fix). **Minor: `MediaInfo.hardware` reports `Some` after a software fallback** (`video.rs`): deferred to #464 (`follow-up`). `Opened` is sent before anything is decoded. A correct value needs either `Opened` to wait for the first frame or a new event, which is an interface choice for Task 67's consumer. The field only feeds `--debug-info`. **Minor: no first frame with `autoplay=false`; audio-only without `AudioOut` ends with `Ended`** (`player.rs`): both fixed, with the tests written first. - The video thread now starts in "landing" mode, so a paused player shows its first frame, as `<video>` does. Task 67 no longer needs `seek(0)`. New test: `paused_open_shows_the_first_frame_only` (shows frame 0, no more frames while paused, no duplicate after `play`). `seek_lands_on_the_exact_frame` now expects `[0, 45]`. - An audio-only file opened without an `AudioOut` is now `Error(Unsupported("audio-only media needs an audio output"))` before `Opened`. New test: `audio_only_without_an_output_is_an_error`, using an in-memory WAV. With an output, the same file opens. READMEs updated: the crate's, `tools/ffmpeg/README.md` and `xtask/README.md`. Local `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` is green.
Author
Owner

Independent review: Text chat 64 (round 2, head 336aeea)

Scope: git diff 978245c..origin/textchat-64-media-playback-crate. I read the code without relying on the implementer's notes.

Checked and OK

  • Plan tests: all 24 named tests and both tests/hw.rs tests exist, and they assert the plan's values: seek 1.5 s lands on counter 45 (gop 30, 30 fps); the +10 ms / −40 ms window shows as 15 frames at 0.5 s and only 44–45 after a jump to 1.5 s; rate 2 reaches frame 30 at 0.5 s of wall time; BT.709 and BT.601 patches match the expected value within ±2; a 64×48 clip is downscaled to 32×24; the 9th player gets Unsupported("too many players"); drop takes under 200 ms and releases the AudioOut; LGPL licence. Each fixture is 20 KB or smaller, and make-fixtures.sh holds the commands that made them.
  • Interfaces: VideoKey::Media { id: u64 }, ByteSource, MemorySource, AudioOut, VideoOut, OpenOptions (default 1920×1080), HwPreference, HwKind, Player::open plus play, pause, seek, set_looping, set_rate, PlayerEvent, MediaInfo, PlaybackError, ffmpeg_info()/FfmpegInfo, hardware_decoders() and MAX_PLAYERS match the plan exactly. The crate's dependencies are only rsmpeg, fluxer-video, thiserror and tracing.
  • Invariants: fluxer-core, fluxer-ui and fluxer-emoji are untouched. No URLs, paths or secrets in code, logs or errors (I/O errors keep only their kind). The committed Windows bindings contain no local paths. The vendored rsmpeg and rusty_ffmpeg are MIT, and each patch is recorded in PATCHES.md.
  • Local FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci in a clean review worktree: all steps passed (rc=0).

Findings

  1. blocking: server data can panic a player thread. demux::to_duration calls Duration::from_secs_f64(ts * num / den), which panics when the value is more than u64::MAX seconds (about 1.8e19). Both ts and the stream time_base come from the file. In Matroska, FFmpeg sets the time base to TimestampScale·TrackTimestampScale / 1e9, with the numerator truncated to 32 bits, so num/den can be about 4. A crafted WebM with 64-bit cluster timecodes near i64::MAX then reaches to_duration from VideoThread::media_time, Demuxer::media_time (audio trim) and the container duration, and panics. The thread dies without an Error event, so the store sees a player that opened and then stalls. The same applies to at + Duration::from_millis(1) in take_frames when at is near Duration::MAX. Fix: use Duration::try_from_secs_f64(..).ok() (or clamp), use checked_add/saturating_add for the frame arithmetic, and add a table test with to_duration(i64::MAX, {num: 4, den: 1}) and similar.
  2. minor: unbounded packet queue when the audio track is shorter than the video. should_read keeps reading past 32 video packets while less than 200 ms of audio is buffered. Once the audio stream is exhausted before EOF, nothing refills it, so the demuxer reads the rest of the file into the video channel. Also, the clock stays on AudioOut::played(), which no longer advances, so video freezes until EOF switches the clock to wall time. This is harmless for small files, but a long video with a short sound track buffers its whole remainder in memory. Suggestion: treat "audio stream gave nothing for N packets" (or audio EOS) as no audio for the margin rule, and switch to wall time then.
  3. minor: the trim arithmetic can overflow. In audio.rs, skip.as_micros() as u64 * VALUES_PER_SECOND overflows when skip is above about 1.9e8 s, which needs a file that claims an absurd duration and a seek into it. It panics in debug builds and wraps in release. Use saturating_mul, or compute from as_secs_f64.
  4. minor (deferred, OK): MediaInfo.hardware can say hardware when get_format silently fell back to software. This is tracked as #464; the deferral is fine.
  5. note: the Windows bindings (mingw-w64 headers parsed for the MSVC target) were checked here only by cargo check/clippy for x86_64-pc-windows-msvc, never linked or run on the Windows runner. The integrator should watch the Windows job after merge, as the implementer says.

Verdict: changes requested. One blocking finding (1); ci is green locally.

## Independent review: Text chat 64 (round 2, head 336aeea) Scope: `git diff 978245c..origin/textchat-64-media-playback-crate`. I read the code without relying on the implementer's notes. **Checked and OK** - Plan tests: all 24 named tests and both `tests/hw.rs` tests exist, and they assert the plan's values: seek 1.5 s lands on counter 45 (gop 30, 30 fps); the +10 ms / −40 ms window shows as 15 frames at 0.5 s and only 44–45 after a jump to 1.5 s; rate 2 reaches frame 30 at 0.5 s of wall time; BT.709 and BT.601 patches match the expected value within ±2; a 64×48 clip is downscaled to 32×24; the 9th player gets `Unsupported("too many players")`; drop takes under 200 ms and releases the `AudioOut`; LGPL licence. Each fixture is 20 KB or smaller, and `make-fixtures.sh` holds the commands that made them. - Interfaces: `VideoKey::Media { id: u64 }`, `ByteSource`, `MemorySource`, `AudioOut`, `VideoOut`, `OpenOptions` (default 1920×1080), `HwPreference`, `HwKind`, `Player::open` plus play, pause, seek, set_looping, set_rate, `PlayerEvent`, `MediaInfo`, `PlaybackError`, `ffmpeg_info()`/`FfmpegInfo`, `hardware_decoders()` and `MAX_PLAYERS` match the plan exactly. The crate's dependencies are only rsmpeg, fluxer-video, thiserror and tracing. - Invariants: fluxer-core, fluxer-ui and fluxer-emoji are untouched. No URLs, paths or secrets in code, logs or errors (I/O errors keep only their kind). The committed Windows bindings contain no local paths. The vendored rsmpeg and rusty_ffmpeg are MIT, and each patch is recorded in `PATCHES.md`. - Local `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` in a clean review worktree: **all steps passed (rc=0)**. **Findings** 1. **blocking: server data can panic a player thread.** `demux::to_duration` calls `Duration::from_secs_f64(ts * num / den)`, which panics when the value is more than u64::MAX seconds (about 1.8e19). Both `ts` and the stream `time_base` come from the file. In Matroska, FFmpeg sets the time base to `TimestampScale·TrackTimestampScale / 1e9`, with the numerator truncated to 32 bits, so num/den can be about 4. A crafted WebM with 64-bit cluster timecodes near i64::MAX then reaches `to_duration` from `VideoThread::media_time`, `Demuxer::media_time` (audio trim) and the container duration, and panics. The thread dies without an `Error` event, so the store sees a player that opened and then stalls. The same applies to `at + Duration::from_millis(1)` in `take_frames` when `at` is near `Duration::MAX`. Fix: use `Duration::try_from_secs_f64(..).ok()` (or clamp), use `checked_add`/`saturating_add` for the frame arithmetic, and add a table test with `to_duration(i64::MAX, {num: 4, den: 1})` and similar. 2. **minor: unbounded packet queue when the audio track is shorter than the video.** `should_read` keeps reading past 32 video packets while less than 200 ms of audio is buffered. Once the audio stream is exhausted before EOF, nothing refills it, so the demuxer reads the rest of the file into the video channel. Also, the clock stays on `AudioOut::played()`, which no longer advances, so video freezes until EOF switches the clock to wall time. This is harmless for small files, but a long video with a short sound track buffers its whole remainder in memory. Suggestion: treat "audio stream gave nothing for N packets" (or audio EOS) as no audio for the margin rule, and switch to wall time then. 3. **minor: the trim arithmetic can overflow.** In `audio.rs`, `skip.as_micros() as u64 * VALUES_PER_SECOND` overflows when `skip` is above about 1.9e8 s, which needs a file that claims an absurd duration and a seek into it. It panics in debug builds and wraps in release. Use `saturating_mul`, or compute from `as_secs_f64`. 4. **minor (deferred, OK): `MediaInfo.hardware`** can say hardware when `get_format` silently fell back to software. This is tracked as #464; the deferral is fine. 5. **note: the Windows bindings** (mingw-w64 headers parsed for the MSVC target) were checked here only by `cargo check`/clippy for x86_64-pc-windows-msvc, never linked or run on the Windows runner. The integrator should watch the Windows job after merge, as the implementer says. **Verdict: changes requested.** One blocking finding (1); ci is green locally.
to_duration clamps to MAX_MEDIA_TIME (i64::MAX microseconds) through
try_from_secs_f64 instead of from_secs_f64, which panicked on crafted
Matroska timecodes and time bases. Seek targets are clamped the same way;
the video thread's frame comparisons and the playback clock add
saturating; the audio trim computes its value count in u128 (values_in).
Table tests for to_duration and values_in.

Refs #404

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Author
Owner

Review round 2, addressed in 041dda0:

Blocking: to_duration panic (demux.rs). to_duration now goes through Duration::try_from_secs_f64 and clamps to a new MAX_MEDIA_TIME (i64::MAX µs, about 292,000 years), so an absurd timestamp or time base yields a capped time instead of a panic. The cap also keeps every later as_micros() → i64 conversion and addition in range. In addition, Demux::seek clamps its target to MAX_MEDIA_TIME. VideoThread::take_frames (at + 1 ms) and present (now + EARLY, at + LATE) use saturating_add. PlaybackClock::position_of replaces mul_f64 (which panics on overflow) with try_from_secs_f64 and saturating_add. Test first: the table test demux::tests::to_duration_never_panics_and_stays_in_range panicked inside from_secs_f64 before the fix. It covers NOPTS, a zero denominator, negative values, i64::MAX with 4/1 and i32::MAX/1, and i64::MIN.

Minor: audio trim overflow (audio.rs). The new values_in(Duration) -> usize computes in u128 (it cannot overflow, even at Duration::MAX) and saturates to usize. The table test values_in_saturates_on_absurd_skips includes the 2e8 s case and Duration::MAX.

Minor: should_read queues all video once the audio ends first (player.rs). Not cheap to fix properly: it needs a hard cap on queued video plus a switch to wall time while the audio is drained, and a clip whose audio is shorter than its video. Deferred to #469 (follow-up).

Minor: MediaInfo.hardware after a silent software fallback (hw.rs). Left as is. The deferral to #464 stands.

Minor: Windows bindings from mingw-w64 headers. No code change. They pass cargo check and clippy for x86_64-pc-windows-msvc but have not been linked or run on the Windows runner yet. Integrator: please watch the Windows job after merge.

Local FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci: all steps passed.

Review round 2, addressed in 041dda0: **Blocking: `to_duration` panic (demux.rs).** `to_duration` now goes through `Duration::try_from_secs_f64` and clamps to a new `MAX_MEDIA_TIME` (`i64::MAX` µs, about 292,000 years), so an absurd timestamp or time base yields a capped time instead of a panic. The cap also keeps every later `as_micros()` → `i64` conversion and addition in range. In addition, `Demux::seek` clamps its target to `MAX_MEDIA_TIME`. `VideoThread::take_frames` (`at + 1 ms`) and `present` (`now + EARLY`, `at + LATE`) use `saturating_add`. `PlaybackClock::position_of` replaces `mul_f64` (which panics on overflow) with `try_from_secs_f64` and `saturating_add`. Test first: the table test `demux::tests::to_duration_never_panics_and_stays_in_range` panicked inside `from_secs_f64` before the fix. It covers NOPTS, a zero denominator, negative values, `i64::MAX` with 4/1 and `i32::MAX`/1, and `i64::MIN`. **Minor: audio trim overflow (audio.rs).** The new `values_in(Duration) -> usize` computes in u128 (it cannot overflow, even at `Duration::MAX`) and saturates to `usize`. The table test `values_in_saturates_on_absurd_skips` includes the 2e8 s case and `Duration::MAX`. **Minor: `should_read` queues all video once the audio ends first (player.rs).** Not cheap to fix properly: it needs a hard cap on queued video plus a switch to wall time while the audio is drained, and a clip whose audio is shorter than its video. Deferred to #469 (follow-up). **Minor: `MediaInfo.hardware` after a silent software fallback (hw.rs).** Left as is. The deferral to #464 stands. **Minor: Windows bindings from mingw-w64 headers.** No code change. They pass `cargo check` and clippy for `x86_64-pc-windows-msvc` but have not been linked or run on the Windows runner yet. **Integrator:** please watch the Windows job after merge. Local `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci`: all steps passed.
Author
Owner

Independent review, Task 64 (round 3, head 041dda0)

Reviewed git diff 978245c..origin/textchat-64-media-playback-crate: crates/fluxer-media-playback, the VideoKey::Media variant in fluxer-video, the vendored rsmpeg/rusty_ffmpeg (PATCHES.md read), the committed Windows bindings and the xtask ffmpeg binding install.

What I checked

  1. Tests the plan names: all 24 exist (plus media_key_is_distinct_from_other_keys in fluxer-video/src/bus.rs and the two FLUXER_HW_DECODER_TESTS=1 tests in tests/hw.rs) and assert what the plan says. For example, seek_lands_on_the_exact_frame uses 30 fps, gop 30, seek 1.5 s and expects counter 45. bt709_input_comes_out_bt601_limited allows ±2. ninth_player_is_refused expects Unsupported("too many players"). drop_joins_threads_quickly expects < 200 ms. The 3 fixtures are 2.7, 6.6 and 7.9 KB (limit 20 KB). Their metadata holds only encoder tags, with no paths. make-fixtures.sh is present.
  2. Interfaces: these match the Interfaces block exactly: ByteSource, MemorySource(Arc<[u8]>), AudioOut (push/played/queued/pause/flush), VideoOut, OpenOptions (default max 1920×1080), HwPreference::{Auto, Off}, HwKind::{Vaapi, Nvdec, D3d11va}, Player::open(...) and its play/pause/seek/set_looping/set_rate, PlayerEvent, MediaInfo, PlaybackError::{Open, Unsupported, Io, Decode}, ffmpeg_info() -> FfmpegInfo, hardware_decoders(), MAX_PLAYERS = 8 and VideoKey::Media { id: u64 }. The crate depends only on rsmpeg, fluxer-video, thiserror and tracing. rsmpeg is pinned =0.18.0.
  3. Invariants: the diff does not touch fluxer-core, fluxer-ui or fluxer-emoji. No URLs, paths or secrets appear in code, fixtures or logs. PlaybackError strings are FFmpeg error text or io::ErrorKind only. The round-2 overflow fixes hold: to_duration uses try_from_secs_f64 capped at MAX_MEDIA_TIME, seek targets are capped, the clock uses try_from_secs_f64 plus saturating_add, video timestamps use saturating adds, and values_in is computed in u128. Each fix has a table test. The FFmpeg callbacks are wrapped in catch_unwind. Deferrals #464 and #469 exist as open follow-up issues.
  4. Review Focus: item 7 (server data never panics) is covered by the truncated, garbage, faststart-cut and timestamp-overflow tests.
  5. FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci in a fresh review worktree: all steps passed (ffmpeg fetch, fmt, clippy, deny, core-isolation, parity, tests). I did not check the remote Windows run. The committed win-x64 bindings still need the integrator to watch it, as the PR already says.

Findings

  • minor: audio.rs Resampler::convert sizes its output with swr_get_out_samples, which scales by 48000 / sample_rate. A crafted file with an absurdly low sample rate (for example a 1 Hz WAV, and the wav demuxer is enabled) makes each decoded frame allocate hundreds of MB, then queue it in pending. This does not panic, but server data can cause a large memory spike. Suggestion: reject audio with sample_rate below about 4000 Hz (play the video without sound, or Unsupported when the file is audio-only), or cap room. This can be a follow-up.
  • minor: in player.rs, Drop decrements OPEN_PLAYERS even when it detaches a thread that is still blocked in read_at. With a stalled HttpRangeSource, more than MAX_PLAYERS sets of player threads can exist at once. The cap is a soft limit in that case. Worth a note in the README or a follow-up.

No blocking findings.

Verdict: approve (0 blocking, 2 minor; local ci green).

## Independent review, Task 64 (round 3, head 041dda0) Reviewed `git diff 978245c..origin/textchat-64-media-playback-crate`: `crates/fluxer-media-playback`, the `VideoKey::Media` variant in `fluxer-video`, the vendored `rsmpeg`/`rusty_ffmpeg` (PATCHES.md read), the committed Windows bindings and the `xtask ffmpeg` binding install. **What I checked** 1. **Tests the plan names:** all 24 exist (plus `media_key_is_distinct_from_other_keys` in `fluxer-video/src/bus.rs` and the two `FLUXER_HW_DECODER_TESTS=1` tests in `tests/hw.rs`) and assert what the plan says. For example, `seek_lands_on_the_exact_frame` uses 30 fps, gop 30, seek 1.5 s and expects counter 45. `bt709_input_comes_out_bt601_limited` allows ±2. `ninth_player_is_refused` expects `Unsupported("too many players")`. `drop_joins_threads_quickly` expects < 200 ms. The 3 fixtures are 2.7, 6.6 and 7.9 KB (limit 20 KB). Their metadata holds only encoder tags, with no paths. `make-fixtures.sh` is present. 2. **Interfaces:** these match the Interfaces block exactly: `ByteSource`, `MemorySource(Arc<[u8]>)`, `AudioOut` (push/played/queued/pause/flush), `VideoOut`, `OpenOptions` (default max 1920×1080), `HwPreference::{Auto, Off}`, `HwKind::{Vaapi, Nvdec, D3d11va}`, `Player::open(...)` and its play/pause/seek/set_looping/set_rate, `PlayerEvent`, `MediaInfo`, `PlaybackError::{Open, Unsupported, Io, Decode}`, `ffmpeg_info() -> FfmpegInfo`, `hardware_decoders()`, `MAX_PLAYERS = 8` and `VideoKey::Media { id: u64 }`. The crate depends only on `rsmpeg`, `fluxer-video`, `thiserror` and `tracing`. `rsmpeg` is pinned `=0.18.0`. 3. **Invariants:** the diff does not touch `fluxer-core`, `fluxer-ui` or `fluxer-emoji`. No URLs, paths or secrets appear in code, fixtures or logs. `PlaybackError` strings are FFmpeg error text or `io::ErrorKind` only. The round-2 overflow fixes hold: `to_duration` uses `try_from_secs_f64` capped at `MAX_MEDIA_TIME`, seek targets are capped, the clock uses `try_from_secs_f64` plus `saturating_add`, video timestamps use saturating adds, and `values_in` is computed in u128. Each fix has a table test. The FFmpeg callbacks are wrapped in `catch_unwind`. Deferrals #464 and #469 exist as open `follow-up` issues. 4. **Review Focus:** item 7 (server data never panics) is covered by the truncated, garbage, faststart-cut and timestamp-overflow tests. 5. **`FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci`** in a fresh review worktree: **all steps passed** (ffmpeg fetch, fmt, clippy, deny, core-isolation, parity, tests). I did not check the remote Windows run. The committed `win-x64` bindings still need the integrator to watch it, as the PR already says. **Findings** - **minor**: `audio.rs` `Resampler::convert` sizes its output with `swr_get_out_samples`, which scales by 48000 / `sample_rate`. A crafted file with an absurdly low sample rate (for example a 1 Hz WAV, and the `wav` demuxer is enabled) makes each decoded frame allocate hundreds of MB, then queue it in `pending`. This does not panic, but server data can cause a large memory spike. Suggestion: reject audio with `sample_rate` below about 4000 Hz (play the video without sound, or `Unsupported` when the file is audio-only), or cap `room`. This can be a follow-up. - **minor**: in `player.rs`, `Drop` decrements `OPEN_PLAYERS` even when it detaches a thread that is still blocked in `read_at`. With a stalled `HttpRangeSource`, more than `MAX_PLAYERS` sets of player threads can exist at once. The cap is a soft limit in that case. Worth a note in the README or a follow-up. No blocking findings. **Verdict: approve** (0 blocking, 2 minor; local ci green).
charles manually merged commit 03ad7edbf4 into textchat 2026-11-13 16:12:21 +00:00
Sign in to join this conversation.
No description provided.