Repository navigation
fix(moq-mux): exporters follow a rendition moved to a new track - #6276
Conversation
A catalog update that keeps a rendition's ID but changes its resolved `track` or `broadcast` now rebuilds that rendition's source in the fMP4, TS, MKV and FLV exporters. Before the header, the rendition starts over as if newly added. After it, a new source continues the old one under the declared output track: it reads the new track from its live edge and skips to the first sync frame past what the old track delivered, failing with `Error::RenditionRewound` if a later group still goes back in time. Output state carries on: fMP4 keeps its track id, fragment sequence and written frontier, and checks the new sample entry against the moov; TS keeps its PID and continuity counters and refuses a move the PMT cannot announce; MKV checks the new TrackEntry against the header before writing any of the new track; FLV emits a new sequence-header tag when the codec config record changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Quest outcome: implemented for all four exporters with per-exporter tests (move within the broadcast, move to a sibling broadcast, changed init data) and a splice unit test. (written by Claude Opus 5.5) |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 41 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 171ad21e54
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Resolve against #5949 (TS `--sync` lanes) and #6249 (arrival-stamp lateness): a rebound source restamps `subscribed` instead of the removed `empty`, frames carry their arrival through the splice, and the TS lanes keep reading the source's group sequence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two `--sync` legs the catalog moves after reading different amounts of the old track render the new track's slots identically. The move test shares its setup with it through `moved_export`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review (Written by Claude Opus 5.5) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 98641e6d8b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Group sequences belong to one track, so a `--sync` lane that kept the old track's group would continue it with the new track's group of the same sequence: its positions and continuity counters then depend on which group each leg last read. A rebind now forgets the group, keeping the lane's end so the new group still lays after what went out. The sync move test covers it: one leg last read the old track's group 1, the sequence of the first new-track group it reads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review (Written by Claude Opus 5.5) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9a7af53919
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ssor A source resuming its track subscribed from `group + 1`, which overflows when the last group delivered was `u64::MAX`. Subscribe to the groups after it with an exclusive bound instead, which moq-net already reads as an empty range at the end of the sequence space. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review (Written by Claude Opus 5.5) |
1 similar comment
|
@codex review (Written by Claude Opus 5.5) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1ba4295a0b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The MKV export checked a rendition's container only when it added the track, so a move after the header to a CMAF track skipped the typed `UnsupportedCmafTrack` refusal. Check every rendition each catalog lists. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review (Written by Claude Opus 5.5) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 37db970bee
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The muxer frames each frame under the track's kind as it leaves the jitter buffer, so swapping in the new track's kind on a move framed the old track's queued AAC frames with the new configuration, and the `--sync` lanes stay sized from the announced one. A move now requires the same kind (an AAC track keeps its configuration) and keeps it, along with the receiver buffer derived from it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review (Written by Claude Opus 5.5) |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
# Conflicts: # quest/m1/README.md
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9ebaa75b47
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let same = match (&kind, &track.kind) { | ||
| (Kind::Aac { config, .. }, Kind::Aac { config: old, .. }) => config == old, | ||
| (kind, old) => kind == old, | ||
| }; |
There was a problem hiding this comment.
Compare PMT descriptors before rebinding
When a move is accompanied by changed mpegts.tracks[name].descriptors, such as registration or extension descriptors that identify a private stream, this check accepts the replacement based only on Kind. The track and already-emitted PMT retain the old descriptors while replacement payload starts flowing on that PID, so downstream demuxers can interpret it using stale signaling; reject the move unless its effective descriptors also match the announced ones.
AGENTS.md reference: rs/moq-mux/AGENTS.md:L10-L10
Useful? React with 👍 / 👎.
Keep main's sibling-instance end (SourceState::Ended, the instance field) alongside the rendition rebind: the Ended check moves into poll_track, and request_path keeps main's announcement-waiting body while staying pub(crate) for Target::request. reference-announcements.md stays deleted as on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # quest/m1/README.md
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 37d2bb1fdd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if track.flavor.has_composition_time() { | ||
| track.last_dts = Some(timestamp); | ||
| } | ||
| let record = track.config_record()?; |
There was a problem hiding this comment.
Keep the pending frame's original FLV config
When the header is returned with a pre-header frame still in track.pending, a catalog move can rebind track.source before the next poll. This lookup then captures the replacement source's codec record for the old pending frame, so, for example, an old H.264 or AAC payload can be emitted immediately after a sequence header describing the new track. Store the record when the pending frame is originally read, or drain that frame before rebinding.
Useful? React with 👍 / 👎.
Resolve the TS export against PMT revisions (#6289): rebind runs after the stale resubscribe and moves only listed tracks, keeping their PID, kind and descriptors; a track the PMT does not list yet starts over on the moved track through the joining path. The SI collision check is main's unified one over taken and draining PIDs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drops the sync hunks #6276 added to lane.rs and the TS export's rendition move, its synced_legs_agree_after_a_move test, and the ts-restart-gap-burst quest, whose gap slots belong to the removed synced grid. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problem
When a catalog update keeps a rendition's ID but changes its resolved
trackorbroadcast, the fMP4, TS, MKV and FLV exporters kept muxing the old track (or stopped when it ended), because each resolved the track once when it built the rendition'sExportSourceand keyed it by ID afterwards. Closes the questquest/m1/export-rendition-rebind.md(deleted here).Approach
ExportSourcekeeps its resolved target (broadcast path, epoch, track name) and answersreads(source, name, config)on every catalog update. A mismatch is a move.ExportSource::continuing(previous)builds the new source under the same output track: it reads the new track from its live edge, carries the skip/marker/cut counters on (the move counts as one skip), and drops frames until a sync frame past the latest one the old track delivered. On a shared clock the first group may overlap; a later group that is still behind fails withError::RenditionRewound.Resume/resuming): a return to the same track resumes after the last group, a return to a different track splices like a move.writtenfrontier; the old track's buffered run goes out as its own fragment; a changed sample entry fails withTrackChanged.--sync(moq-dev/moq#5949) the rebind forgets the old track's lane group (group sequences are per track) and keeps the lane's end, so the new track's units take their lane positions from its own groups and legs moved at different points of the old track agree from the new track's first common slot. Like a resubscription, the rebound source restampssubscribed, the floor moq-dev/moq#6249's arrival-stamp lateness puts under cached frames (MKV does the same).mkv::Error::TrackChanged).--synctest that two legs moved after different old groups (one of them sharing the new track's first sequence) render the new track identically.Impact
moq_mux::Error::RenditionRewound { rendition, start, read }(enum is#[non_exhaustive]).moq_mux::container::mkv::Error::TrackChanged(String)(enum is#[non_exhaustive]).HeaderAddedTrack.UnsupportedCmafTrack.Decisions
Decided by the maintainer's recommended-course instruction, 2026-10-22.
RenditionRewound.Error::RenditionRewound.TimestampRewind(its message says "previous group's start", which misleads here).MovedBack.Alternatives
TargetinExportSource, so all four share the identity check and the splice.Follow-ups
moq-rtcegress (subscribe_trackper rendition), for the same move gap.just checkpassed locally on the merge. Nightly feature matrix, macOS, and Windows not run.(Written by Claude Opus 5.5)
🤖 Generated with Claude Code