Repository navigation
Conversation
Quest-Claim: abbfd3907579bd88
…chors A rate the import measures after the export's tables but before the jitter clock anchors found no margin yet and grew the send-ahead not at all, so a slow multiplex missed audio decode deadlines (ffmpeg_ac3.ts at a 2 s delay). Grow freely until the clock anchors, and use the spare since the anchor until a whole second has passed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Works on quest/m1/ts-export-audio-rate.md. Draft: the long-delay case is fixed, short delays need a decision.
Summary
A
moq export tsthat took up a measured rate while its jitter clock was still being acquired found no margin yet, so its audio send-ahead stayed where it was. At the recorded rate the audio then missed decode deadlines. Onffmpeg_ac3.tswith a 2 s delay, the rate arrives at +1.8 s, before the clock anchors.rs/moq-mux/src/container/ts/export.rs: the send-ahead grows freely until the clock anchors (as it already did before the tables). In the first second after the anchor, it grows by the spare seen since the anchor. A pending replacement program reads its own jitter engine, not the active one's.rs/moq-mux/src/jitter.rs: addsEngine::spare_seen, which is the margin, or the least spare so far before a whole second has passed, andNoneuntil a frame has a deadline.Buffer::readingbecomes crate-visible.Anchor check (from the 2026-11-26 decision)
The decision was to grow freely until the first release and to check whether the anchor really stays open until then. It doesn't always:
So I gated on the anchor, not the release. After the anchor, the spare measured since then bounds growth.
Public API / wire impact
None (crate-internal).
Validation
an_ffmpeg_audio_source_measured_while_its_clock_is_acquired_keeps_its_audio_on_time: all sixffmpeg_*.tsfixtures,Rate::Measured, delays of 500 ms, 2 s, and 3 s. It drops nothing and pads above the recorded rate. It fails without the fix.the_margin_is_the_least_spare_over_a_secondto coverspare_seen.cargo nexteston everycontainer::tstest plus the jitter test: 801 passed.cargo clippy -p moq-mux --all-targets -D warningsandcargo fmt --checkare clean. Injust check, onlyrs_crossfailed, on this host's toolchain (alloca: LTO requires LLD), unrelated to the diff.What remains
The quest is rewritten to what's left: short delays (100 ms, and mp2 at 300 ms). There, FFmpeg's ~186 ms PES packing already makes frames late, the spare is negative, and the export fails where a given-rate export only drops frames. Also eac3 at 300 ms drops one frame from the post-second margin cap; this predates this PR. Lifting the cap entirely was tried and drops frames at 500 ms and 1 s, so it's out.
Waiting
Caused by
Follow-ups
None; the remainder stays in this quest.
Models
Size: M
Implementer: Claude Code, claude-opus-5-5, unknown (arm A, cohort advisor-2026-11)
🤖 Generated with Claude Code
(Written by Opus 5.5)