Repository navigation
fix(mux): retire TS tracks a PMT revision drops or changes #6208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kixelated
merged 9 commits into
moq-dev:main
from
t0ms:quest/m1/ts-reliability/pmt-lifecycle
Oct 22, 2026
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e77eeaf
fix(mux): retire TS tracks a PMT revision drops or changes
t0ms a64f30f
fix(mux): route a PID listed twice by its first entry; keep a retired…
t0ms aa6a17c
Merge remote-tracking branch 'origin/main' into quest/m1/ts-reliabili…
t0ms 605059c
fix(mux): bound TS route churn and refuse a PMT listing a PID twice
t0ms 701ef60
fix(mux): refuse a PMT revision that would drop unanchored TS data
t0ms 3cfc92b
fix(mux): bound TS program descriptor churn and start from the catalo…
t0ms ef89cf0
fix(mux): keep a revised TS route until it ends, so a refusal aborts it
t0ms 3c8b541
fix(mux): count a revised TS route's unit unplaced past a lone PCR, a…
t0ms 6c82b36
Merge remote-tracking branch 'origin/main' into quest/m1/ts-reliabili…
t0ms File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # [M] Live PAT changes keep programs honest | ||
|
|
||
| ## Goal | ||
|
|
||
| A live TS source whose PAT changes mid-stream keeps every broadcast meaning | ||
| one program. A moved PMT PID, a program added, and a program removed or | ||
| returning each have one observable outcome: followed, published, retired, | ||
| or published as a new epoch. None is silently ignored. | ||
|
|
||
| ## Plan | ||
|
|
||
| What the code does today: | ||
|
|
||
| - A PAT naming another PMT PID for the program adds a reassembler but never | ||
| drops the old one, and `program.pmtPid` keeps the first. | ||
| - `Programs` ignores a program a later PAT adds, without a warning. | ||
| - Under `--program all`, a later PAT that removes one program reaches every | ||
| per-program `Import`; the removed program's `handle_pat` errors, | ||
| `Programs::feed` propagates it, and the whole multiplex ingest stops, | ||
| including unrelated programs. | ||
| - A PAT naming another `transport_stream_id`, or a single-program import's | ||
| PAT naming another program, already refuses the import. | ||
|
|
||
| Decided 2026-10-20 by the maintainer: | ||
|
|
||
| - A new PMT PID for the same program moves the reassembler and updates | ||
| `program.pmtPid`, which the export follows with a new PAT. `Programs` | ||
| publishes a program a later PAT adds as its own broadcast, as it does for | ||
| the first PAT, rather than ignoring it. | ||
| - A later PAT that removes a program retires that program's broadcast: its | ||
| tracks finish and it is unannounced, while the other programs carry on. | ||
| If the program returns, it publishes a new epoch of its broadcast, never | ||
| the retired instance's names for new content. A single-program import | ||
| whose selected program leaves the PAT ends, as today. | ||
| - Open: a PAT that names a program whose PMT never arrives. Decide whether | ||
| the import refuses it or waits, and which clock bounds the wait (found in | ||
| [moq-dev/moq#6122](https://github.com/moq-dev/moq/pull/6122)). | ||
|
|
||
| Rust: `rs/moq-mux` TS `Import::handle_pat` and `Programs`. | ||
|
|
||
| Tests use the generated `fixture::Mux` builder: a PMT PID move, and a | ||
| `--program all` MPTS whose PAT adds a program, drops one and later restores | ||
| it: the other program runs uninterrupted, and the returning one publishes a | ||
| new epoch. | ||
|
|
||
| ## Related | ||
|
|
||
| - [PMT export](/quest/m1/ts-reliability/pmt-export.md) - the export follows a moved PMT PID with a new PAT |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # [M] TS export follows a PMT revision | ||
|
|
||
| ## Goal | ||
|
|
||
| A TS export of a broadcast whose layout changes mid-stream announces the | ||
| revised layout as an ordinary PMT revision. A track added, retired, or | ||
| replaced under a fresh name changes the PMT at the next `version_number`; | ||
| nothing else blips. | ||
|
|
||
| ## Plan | ||
|
|
||
| The import already keeps track names honest: a changed `stream_type` or ES | ||
| descriptor loop finishes the old track, drops its catalog entry, and opens | ||
| a new uniquely named one; a removed stream finishes its track and leaves | ||
| the catalog; `programDescriptors` updates in place; a program identity | ||
| change refuses. | ||
|
|
||
| What the export does today: | ||
|
|
||
| - `Export` builds the PAT/PMT once. A track added afterward fails the export | ||
| ("TS track layout changed after PAT/PMT was emitted"), so every revision | ||
| the import publishes ends the export. | ||
| - A track that leaves the catalog keeps its PID in the PMT forever, and | ||
| `programDescriptors` is read once. | ||
| - A switch to another instance already rebuilds the tables at the next | ||
| `version_number`. | ||
|
|
||
| Decided 2026-10-20 by the maintainer: | ||
|
|
||
| - Export rebuilds the PMT at the next `version_number` when the track set | ||
| or an entry changes, drops a retired track's PID once its track ends, and | ||
| keeps the PCR PID unless its track retires. A TS receiver sees an | ||
| ordinary PMT revision and a Hang player sees a rendition switch. | ||
|
|
||
| A `programDescriptors` change is an entry change too: the PMT carries the | ||
| revised `program_info` at the next `version_number`. | ||
|
|
||
| Rust: `rs/moq-mux` TS export. Draft | ||
| ([mpegts](/drafts/draft-lcurley-moq-mpegts.md)): the rebuild section says | ||
| how a consumer revises the PMT. | ||
|
|
||
| Tests use the generated `fixture::Mux` builder through import and export: | ||
| PMT add, remove, retype, descriptor-only change, version rollover (31 to | ||
| 0), PID reuse after removal, and a program descriptor change, each | ||
| asserting the exported PMT's streams and version sequence. Extend the | ||
| TSDuck round trip with a generated mid-stream PMT revision so | ||
| `compliance.py` checks the rebuilt version sequence in CI. | ||
|
|
||
| ## Related | ||
|
|
||
| - [PAT changes](/quest/m1/ts-reliability/pat-lifecycle.md) - a moved PMT PID reaches the export as a new PAT | ||
| - [Hitless TS](/quest/m2/ts-hitless.md) - identical legs must revise their PMT identically | ||
This file was deleted.
Oops, something went wrong.
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.