Skip to content

fix: catalog readers follow a moved rendition - #6650

Merged
kixelated merged 3 commits into
mainfrom
quest/m1/rendition-move-follow
Oct 24, 2026
Merged

kixelated merged 3 commits into
mainfrom
quest/m1/rendition-move-follow

Conversation

@kixelated

@kixelated kixelated commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

moq-dev/moq#6276 made the exporters follow a rendition that a catalog update moves to another track or sibling broadcast. Other catalog readers resolved the track once. This PR finishes the quest quest/m1/rendition-move-follow.md and deletes it.

Audit

Reader Before Now
moq-rtc egress (server subscribe, client publish, export rtc) The pump compared renditions by catalog ID, so a moved rendition kept serving its old track. It compares the resolved track (broadcast path, epoch, track name). A move switches like any other pick: the new track is subscribed beside the old one, the old one is paced to it, and the line switches at its first keyframe past the playhead.
moq play A half only picked again once its track ended, so a move whose old track kept sending was never followed. A snapshot that moves the playing rendition retires it. Audio ends where it stands, as on a finish, so the old sink's tail plays out while the new track fills. Video stops, keeping the frames already queued for the window. The half then picks again from that snapshot. A retired track is not recorded as finished, so moving back to it plays it.
moqsrc (moq-gst source) Already followed: Shape holds the track, broadcast and epoch, so a reshape hands the pad to a new reader, and a move to a sibling moves the rendition between followers on the same pad. Unchanged. Added a test.
moq-ffi MoqAudioConsumer / MoqVideoConsumer They never read the catalog. The caller passes one rendition and they subscribe to it. Unchanged: following the catalog is the caller's job, and it re-subscribes when a snapshot names another track.

moq-transcode already rebuilds when a rendition's track changes (pipeline.rs), so I left it alone.

Tests

One move test for each reader, each with the old track still sending after the move:

  • moq-rtc: a_moved_rendition_follows_its_new_track moves within the broadcast, then to a sibling, and checks pacing, the keyframe switch, and that nothing from the old track is served afterwards.
  • moq play: a_moved_audio_rendition_plays_its_new_track moves a -> b -> a. The test checks there is no gap at either move, each retired tail plays in full, and nothing the old track sent after a move is heard. The move back proves a retired track is not counted as finished.
  • moqsrc: a_moved_rendition_plays_on_the_same_pad moves within the broadcast, then to a sibling. Playback stays on one pad with no EOS, and nothing from the old track reaches the pad after the move.

I confirmed the egress and play tests fail without the fix.

Decisions made without asking

  • moq play audio retires instead of cutting. A disable still cuts at once. A move ends the old track as if it finished, so the switch costs no silence, the same as a finished-track switch (#3966).
  • moq play video stops at once on a move. It keeps no tail beyond the window's frame queue.
  • moq play ignores a change of epoch alone. Its Track is still (resolved path, track name). Source::resolve pins a sibling's first instance, so following an epoch-only change would hit EpochMismatch and could end the player. Following instances is Readers follow restarts. The egress Target does include the epoch, matching ExportSource: if the new epoch fails to resolve, the subscribe fails with a warning and the line stays on its current track.
  • No shared public Target type in moq-mux. Each reader keeps its own small identity type (ExportSource's private Target, moqsrc's Shape, play's Track, the egress Target). A public type would add API surface just to remove three short structs.

Impact

  • Public API: none.
  • Wire: none.
  • Behavior: the WebRTC egress and moq play switch to a moved rendition's new track.

Coordination

This PR does not touch the moq-cli or moq-gst reader loops covered by Readers follow restarts. The moqsrc change is a test, plus a Publisher::frame helper in its test module. In moq play it changes rendition selection inside play_broadcast, not the instance follow loop.

Checks

  • just check passed locally after merging the latest main. It ran all 522 tests, the play feature tests included.
  • just test interop --all was not run: no wire, moq-ffi, or gateway change.
  • The nightly feature matrix, macOS and Windows were not run.

Follow-ups

  • moq play retires a moved rendition before it subscribes to the new one, so video can freeze until the new track's first keyframe decodes. Serving the old track until the new one is ready, as the egress does, would remove that freeze.

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

kixelated and others added 3 commits October 24, 2026 09:17
The WebRTC egress keyed its serving rendition by catalog ID and `moq play`
only re-picked once a track ended, so a catalog update moving a rendition to
another track (or sibling broadcast) left both on the old one. The egress now
compares the resolved track and switches like any other pick; `moq play`
retires the moved rendition (audio plays out its sink's tail) and picks again.
moqsrc already restarted a reshaped rendition on its pad; a test now covers it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title Catalog readers follow a moved rendition fix: catalog readers follow a moved rendition Oct 24, 2026
@kixelated
kixelated marked this pull request as ready for review October 24, 2026 16:43
@coderabbitai

coderabbitai Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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 7 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0d80a3af-0522-439c-8080-9a23e38b8236
Commits

Reviewing files that changed from the base of the PR and between c0145f1 and 137e238.

Files selected for processing: 6
  • quest/m1/README.md
  • quest/m1/rendition-move-follow.md
  • rs/moq-cli/src/play/media.rs
  • rs/moq-cli/src/play/playback.rs
  • rs/moq-gst/src/source/imp.rs
  • rs/moq-rtc/src/egress.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T16:44:48.956063Z 137e238 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kixelated

Copy link
Copy Markdown
Collaborator Author

Landing head 137e238 with maintainer approval.

  • Changes: the moq-rtc egress and moq play now follow a rendition that a catalog update moves to another track or sibling broadcast; moqsrc already did and gains a test. The finished quest quest/m1/rendition-move-follow.md is deleted.
  • Decisions: as listed in the PR body (play audio retires instead of cutting, play video stops at once, play ignores an epoch-only change, no shared public Target type). None left open.
  • Review: Codex reviewed this head with no findings. Required checks pass; quest check against origin/main passes.
  • Follow-up: moq play could keep serving the old video track until the new one is ready, removing the keyframe freeze on a move.

(Written by Claude Opus 5.5)

@kixelated
kixelated added this pull request to the merge queue Oct 24, 2026
Merged via the queue into main with commit abf3fc4 Oct 24, 2026
11 checks passed
@kixelated
kixelated deleted the quest/m1/rendition-move-follow branch October 24, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant