hang: re-emit deprecated CMAF timescale/trackId in catalog#1440
Conversation
Players that predate the `init` field in the CMAF container parse `timescale` and `trackId` directly off the catalog. The current schema moves both into the base64 init segment, which breaks those older players (e.g. anything pinned to `@moq/hang@0.2.4`). Add both fields back as optional, `#[deprecated]` for Rust consumers, and populate them on the fMP4 import path so newly-published catalogs stay readable by old and new clients alike. The JS schema accepts them as optional so round-tripping is clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
WalkthroughThis pull request extends the CMAF container variant with optional 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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. Comment |
After merging main, Container::Cmaf grew optional deprecated timescale and track_id fields (#1440) that consumers re-derive from init. The MSF catalog doesn't carry either at the wire level, so populate them as None when constructing Cmaf from an MSF track. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Older players parse CMAF
timescaleandtrackIdfrom explicit catalog fields. The current schema moves both into the base64initsegment, which breaks anything pinned to@moq/hang@0.2.4or earlier — see the\$ZodErrorthrown by the deployedmoq-pilotweb client this afternoon, where the new publisher's catalog (init-only) failed validation against the old schema.rs/hang/src/catalog/container.rs: addtimescale: Option<u32>andtrack_id: Option<u32>toContainer::Cmaf, both#[deprecated]and skipped on serialize whenNone. They're accepted (and ignored) on deserialize so catalogs from either side round-trip.rs/moq-mux/src/import/fmp4.rs: populate both fields fromtrak.mdia.mdhd.timescale/trak.tkhd.track_idwhen constructing the CMAF container during fMP4 import. This is the path the publisher actually uses, so freshly-published catalogs now carry the legacy fields again...in the pattern or passNone(FFI fallback / tests).js/hang/src/catalog/container.ts: accept the deprecated fields as optional.Serde's derive doesn't propagate
#[deprecated]into its generated read/write code, and our one populating site uses struct-init syntax that doesn't trigger the lint either, so the workspace builds clean.Test plan
cargo build --workspacecargo test -p hang -p moq-mux(84 passed)@moq/hang@0.2.4) can decode a CMAF catalog from the new publisher.🤖 Generated with Claude Code