Repository navigation
Conversation
Quest-Claim: 8ddbc22ff30bc91a
Under `export ts --sync`, a track the catalog adds, one that ends, and a PID another stream takes over now revise the PMT and the lanes at the first table repetition two slots past the jitter-buffer key of that stream's first or last unit, which every leg reads alike and before its clock reaches it. The lanes become a schedule of layouts by slot; units planned before a revision is read are logged and re-planned on it. The revised PMT's version_number follows from what it lists, so a leg that joins after it announces it alike. An added track no longer fails the export. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EeyiEy5FWz3z44DYZVo7vU
Collaborator
Author
|
Status: the implementation is complete for the cases where the media marks the revision (a track is added, a track ends, a PID is taken over), and (Written by Claude Opus 5.5) |
Collaborator
Author
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.
Quest: quest/m1/ts-reliability/pmt-export.md
Summary
Under
moq export ts --sync, an added track no longer fails the export, and every leg revises its PMT and lanes at the same slot. This builds on #6289, which did the non-sync revision.Reproduced first: two synced legs with an AAC track added mid-stream failed with
TS track layout changed after PAT/PMT was emitted under --sync: '2.aac' added.How a revision lands (the quest's open question):
version_numberis a function of what the PMT lists: each stream adds a term from 1 to 31, and the program descriptors add one more. A leg that joins after a revision therefore announces the same version, and a revision that adds or removes a single stream always changes it.Mechanism:
lane::Lanesis a schedule of layouts by slot, one per revision. Each layout carries its tables, its clock PID and its PMT. Lanes are looked up by PID, and each stream'sRunbounds its own lane.muxRatechange, with no stream change, is logged and ignored, as the rate change already was. See Decisions needed.Tests (two synced legs that joined at different times, a third that joins after the revision, run with each track lagging in turn):
synced_legs_revise_their_pmt_alike_for_an_added_tracksynced_legs_revise_their_pmt_alike_for_a_removed_tracksynced_legs_hand_a_pid_over_alikeEach checks the packets match from the revision on (PMTs and continuity counters included, with no position differing), the revision lands in the same slot on both legs, and the joiner's PMT and version match. New
laneunit tests cover a unit that straddles a revision, a group opening in the revision slot, a unit that runs past the end of its run, and the revision slot's tables, counter flag and clock. I also checked that the legs still agree when one reads only every 300 ms.a_track_added_under_sync_fails_the_exportis deleted because that behavior is gone.Public API and wire impact
Export::with_synckeeps its signature, and its rustdoc now describes revisions.--synconly:version_numberis now derived from the PMT's content instead of starting at 0.Decisions needed
version_numberderived from content (an additive hash, so a single add or remove always changes it). The other option is for the importer to record the source PMT's version in the catalog, which is a wire change and doesn't help non-TS sources. Recommend content-derived. A collision with the previous version is possible only when two streams change at once, or when only the descriptors change (about 1 in 31).muxRatechange alone under--sync. No media marks where it lands, so a leg that opens after it differs from one that saw it. Options: (a) the importer records an effective media time in thempegtssection (wire change and draft update; a rate change also needs lane positions that survive a rate change); (b) apply it with the next media-anchored revision; (c) keep ignoring it with a log line. Recommend (c) in this PR, and (a) as the follow-up. The quest now tracks it.unique_namenames sort in order of creation. Recommend leaving it for the quest's follow-up.Checks
cargo nextest run -p moq-mux: 1691 passed.cargo clippy --all-targets -p moq-mux -D warnings: clean.just check: passed (3704 + 518 + 226 tests, lint, docs).just test interop --all, since this changes no wire format,moq-ffior gateway.Follow-ups
muxRatechanges under--syncand PID assignment for unrecorded names.--syncleg intest/tsthat tsduck grades across a revision.(Written by Claude Opus 5.5)
🤖 Generated with Claude Code
https://claude.ai/code/session_01EeyiEy5FWz3z44DYZVo7vU