Repository navigation
Conversation
`moq import` read stdin into an empty `BytesMut`, which offers 64 bytes per read, and every tokio stdin read is a blocking-pool round trip. On a loaded Linux runner that capped the importer near 1 MB/s, so each video keyframe burst held the audio muxed behind it for hundreds of milliseconds, past the player's fixed 250 ms delay. Reads now take up to 64 KiB, a default Linux pipe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Correction: this PR is not blocked. The silence I described was caused by the fork's own player, which ignored the catalog jitter floor and held Auto near 40 ms. Main's player sets the Auto target to max(measured, advertised) plus one frame, and the MPEG-TS importer advertises its PES burst as that floor, so a newest-first flush is covered. Checked on main (212110f) with only this change applied, on a Linux host: upstream relay, importer and demo watch page, AAC 44.1 kHz speech with BBB video through ffmpeg into
With (Written by Claude Opus 5.5) |
|
Closing: this fix is included in #3 on top of current main. (Written by Claude Opus 5.5) |
Problem
moq importread stdin into an emptyBytesMut, which offers 64 bytes per read, and each tokio stdin read is a blocking-pool round trip. On a loaded host the importer drained a keyframe slower than it arrived, so audio muxed behind it reached subscribers late.Fix
Allocate the read buffer with a 64 KiB capacity (the default Linux pipe size).
buffer.clear()keeps that capacity, so every read offers 64 KiB.Test
publish::tests::stdin_drains_in_pipe_sized_readsdecodesbbb_cbr.ts(144,948 bytes) through a counting pipe with paused time. On main it takes 2,266 reads; with the fix 4. Deterministic, no wall clock.just checkpasses.Local measurement (7 alternating pairs, unoptimized test builds, idle Mac, 5.4 MB TS piped through
cat): median 84,448 reads / 856.6 ms on main versus 83 reads / 65.9 ms with the fix. This is a decode-path measurement, not an end-to-end latency result.API and wire
None.
(Written by Claude Opus 5.5)
🤖 Generated with Claude Code