fix(hang): omit empty HEVC constraint component in codec string#1781
Conversation
HEVC streams whose general_constraint_indicator_flags are all zero produced a codec string ending in a dangling '.' (e.g. `hvc1.1.60.L150.`). The matching `FromStr` then parsed the empty trailing field as a hex int and failed, which surfaces as `json: expected int` and breaks the catalog round-trip for such streams (catalog generation on publish, and subscribe_catalog/subscribe_media on consume). All-zero constraint flags are common in live HEVC from hardware encoders, so this is hit publishing a real camera via `moq-cli ... publish fmp4`. Emit the constraint component (and its leading '.') only when there are significant bytes, and let `FromStr` tolerate an empty trailing field so streams already published with the dangling '.' still parse. Adds a zero-constraint round-trip test; the existing tests are unchanged. Fixes moq-dev#1780 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
thanks, I'll fix the unrelated CI failure |
|
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 (1)
WalkthroughThe 🚥 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✨ Simplify code
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 |
Fixes #1780.
HEVC streams whose
general_constraint_indicator_flagsare all zero produced a codec string endingin a dangling
.(e.g.hvc1.1.60.L150.), whichH265::from_strthen rejected while parsing theempty trailing field as a hex int. This breaks the catalog round-trip for such streams — both
catalog generation on publish and
subscribe_catalog/subscribe_mediaon consume (surfaces tocallers as
json: expected int). All-zero constraint flags are common in live HEVC from hardwareencoders, so it's hit publishing a real camera via
moq-cli … publish … fmp4.Changes —
rs/hang/src/catalog/video/h265.rsDisplay: emit the constraint component (and its leading.) only when there are significantbytes, so all-zero flags yield
hvc1.1.60.L150instead ofhvc1.1.60.L150..FromStr: tolerate an empty trailing field, so streams already published with the dangling.still parse (version skew while producers update).test_h265_zero_constraints(zero-constraint round-trip + dangling-.parse). Theexisting
test_h265/test_h265_long/test_h265_out_of_bandcases are unchanged.cargo test -p hangpasses (4/4 in theh265module).