From d5a5185a1554108004f985318508539b8ddb0023 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Thu, 22 Oct 2026 19:53:57 -0700 Subject: [PATCH] quest: keep the old tail on both 2022-7 legs across a restart Co-Authored-By: Claude Opus 5.5 --- quest/m2/README.md | 1 + quest/m2/ts-sync-restart-tail.md | 33 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 quest/m2/ts-sync-restart-tail.md diff --git a/quest/m2/README.md b/quest/m2/README.md index 4eb8283adc..c42d404782 100644 --- a/quest/m2/README.md +++ b/quest/m2/README.md @@ -134,6 +134,7 @@ ranked just below deterministic TS legs, which it requires. - [Drop announce="never"](/quest/m2/publish-announce-never.md) - `@moq/publish` offers only announce modes a watcher can reach - [Deterministic H.265 TS legs](/quest/m2/ts-hitless-h265.md) - H.265's buffering period gets the same group anchor as H.264 - [TS over RTP legs](/quest/m2/ts-rtp-egress.md) - two legs send identical RTP packets, headers included, so an ST 2022-7 receiver can merge them +- [Old tail across a restart](/quest/m2/ts-sync-restart-tail.md) - both `--sync` legs send the old timeline's tail up to a restart, so an ST 2022-7 merge has no hole there - [moqsrc A/V sync](/quest/m2/moqsrc-av-sync.md) - a nightly test measures A/V skew from `moqsrc` through clock-synced sinks - [MP4 export](/quest/m2/mp4-export.md) - `moq export mp4 --output` records crash-safe fragments, then finishes a regular MP4 with moov at the end - [fMP4 edit lists](/quest/m2/fmp4-edit-lists.md) - the fMP4 importer applies edit lists to frame timestamps diff --git a/quest/m2/ts-sync-restart-tail.md b/quest/m2/ts-sync-restart-tail.md new file mode 100644 index 0000000000..b3961924c7 --- /dev/null +++ b/quest/m2/ts-sync-restart-tail.md @@ -0,0 +1,33 @@ +# [M] Keep the old tail on both 2022-7 legs across a restart + +## Goal + +Two `moq export ts --sync` legs that see a timeline restart (a marker or +source restart that opens a new generation) both send the old timeline's +tail up to the restart, so an ST 2022-7 receiver merging them has no hole +there. Ordinary skips already cost nothing, because the other leg's copies +fill in. + +## Plan + +Found in [moq-dev/moq#6304](https://github.com/moq-dev/moq/pull/6304) +(RTP egress), which this builds on. Each leg's lane forgets the positions it +already holds: `Lane::reset` and `Lane::jump` in +`rs/moq-mux/src/container/ts/lane.rs` clear `from` when the restart is read. +The old tail is laid about one delay later, so all of it is marked unsure and +withheld, costing roughly 0.5 to 1 s of output on both legs at a video and +audio restart. + +- Old-timeline lane knowledge stays valid until the rewind that adopts the + new generation. +- Keeping `[from, end)` known across a skip jump or a partial group is sound. + A restart is not obviously sound: `reset()` sets `end` to 0, and + new-timeline positions can land inside the old range when a restart opens + no new generation. Settle that first: either every restart opens a + generation, or lane knowledge is kept per timeline. +- Reproduce with a mocked-time two-leg test of a video and audio restart that + asserts the merged legs cover the old tail. Extend + `an_rtp_leg_sends_its_paced_tail_before_a_restart` in + `export_timing_test.rs` from that PR if it has merged. + +Public API: none.