Repository navigation
Add moq_media_sender_cfg_t.initial_group_id so a restarted publisher can resume above its Groups - #65
Merged
Conversation
The legacy companion numbers every track's Groups from 0, so a publisher that restarts a Track on drafts 16 and 18, for example when it reconnects after a failed session, reuses Locations of Objects it already published (draft-ietf-moq-transport-22 2.5; MSF-01 6.1). The draft-22 companion starts at the wallclock milliseconds, which is only best effort, and an application cannot choose a base for either. Add an optional initial_group_id / has_initial_group_id pair at the end of the sender config. When set, it is the first Group ID of every track, the generated timeline and the catalog, replacing the companion's default base, and the clock is not read. An AUTO sender keeps it when it resolves to the legacy companion instead of moving its Groups down to 0. A value above MOQ_QUIC_VARINT_MAX fails creation with MOQ_ERR_LIMIT. A config too short to hold the pair behaves as before. The ABI pins for the config are updated for LP64, ILP32 with 4-byte uint64_t alignment and ILP32 with 8-byte alignment.
This was referenced Nov 3, 2026
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.
Problem
The media sender numbers Group IDs itself and gives the application no way to choose the first one. The legacy companion (drafts 16 and 18) always starts every track at Group 0. The draft-22 companion starts at the wallclock in milliseconds, which its comment already calls best effort.
A publisher that restarts a Track must not reuse the Locations of Objects it already published (draft-ietf-moq-transport-22 section 2.5, MSF-01 section 6.1). moqxr hit this: when a live publish fails and is retried in the same process, it carries the next Group IDs forward on its own native backend, but on this backend a retry restarts at Group 0, and it has to refuse a non-zero
--initial-group-idfor the same reason.Change
moq_media_sender_cfg_tgets an optional pair at the end of the struct,initial_group_idandhas_initial_group_id. Whenhas_initial_group_idis true:MOQ_QUIC_VARINT_MAXfails creation withMOQ_ERR_LIMITbefore any allocation, as an unreadable or out-of-range clock does. A value of exactlyMOQ_QUIC_VARINT_MAXis valid.A config whose
struct_sizeis too short to hold the pair behaves as before, and it is only read from a sized initializer like the other appended fields. The default behaviour of both companions is unchanged.The ABI pins in
tests/unit/test_abi_layout_d22.candservice/tests/test_sender_companion.care updated.Testing
Built with
-DMOQ_BUILD_TESTS=ON -DMOQ_BUILD_SIM=ON -DMOQ_BUILD_MSF=ON -DMOQ_BUILD_MEDIA_OBJECT=ON -DMOQ_BUILD_SERVICE=ON -DMOQ_WARNINGS_AS_ERRORS=ONon x86-64 Linux: 491/491 tests pass.New rows in
test_sender_companioncover the legacy and draft-22 companions with a configured base (the draft-22 case fails the clock to show it is not read), a config too short for the field, an AUTO sender resolving to legacy, and theMOQ_QUIC_VARINT_MAXlimit and its refusal. They fail when the field is ignored.Not verified
uint64_talignment) and Windows pins are computed by hand. The i386 pins compile cleanly withgcc -m32, and a deliberately wrong i386 size fails.bindings/rust) and Python bindings and the generatedbindings.rssnapshot are not updated, and I did not run the Rust or the other CI jobs.This change is