Skip to content

fix(api): served-first fmtp verdict for _mainv and _subv (#593) - #613

Merged
badbread merged 1 commit into
mainfrom
fix/fmtp-repair-gaps
Aug 25, 2026
Merged

fix(api): served-first fmtp verdict for _mainv and _subv (#593)#613
badbread merged 1 commit into
mainfrom
fix/fmtp-repair-gaps

Conversation

@badbread

Copy link
Copy Markdown
Owner

Fixes #593. Two pre-existing gaps split out of #592.

1. _mainv was blind to a record-from-sub camera's main. Detection keyed only on the SERVED SDP, which needs a persistent RTSP consumer. A record-from-sub policy leaves the main with no consumer, so the served verdict was permanently None and an fmtp-less HD main never got _mainv.

2. _subv stayed producer-only. A sub whose producer advertises a present-but-incomplete a=fmtp looks healthy on the producer side, but go2rtc serves consumers a broken SDP (the same class #592 found on the main). Producer-only detection missed it.

Fix: unify both on combine_fmtp_verdict(served, producer) = served-first, producer-fallback-positive-only. The served SDP (what the client actually receives) wins when a consumer is attached; with no consumer, a producer that itself positively lacks fmtp still flags, but a healthy-looking Some(false) producer never un-flags, which is exactly the #592 lie. None only when neither side knows, so resolve_needs_subv's sticky rule is preserved. The enabled-but-no-verdict observability log now fires on the combined None.

No on-demand dial: per the issue, the positive-only fallback plus the existing debug signal covers the no-consumer case.

Test: combine_verdict_is_served_first_producer_positive_only covers all served×producer combinations and both invariants.

Gate green on dev2: fmt + clippy -D warnings + cargo test --workspace.

Two pre-existing gaps split out of #592:

1. _mainv keyed only on the SERVED SDP, so a record-from-sub camera's main (no
   persistent RTSP consumer) had a permanent None verdict and an fmtp-less HD
   main never got _mainv.
2. _subv stayed producer-only, so a sub with a present-but-incomplete a=fmtp
   (producer looks healthy, go2rtc serves a broken SDP) never got _subv.

Unify both on a served-first, producer-fallback-POSITIVE-ONLY verdict
(combine_fmtp_verdict): the served SDP wins when a consumer is attached; with no
consumer, a producer that itself positively lacks fmtp still flags, but a
healthy-looking Some(false) producer never un-flags (the #592 lie). The
enabled-but-no-verdict observability log now fires on the combined None.

Pure verdict helper is unit-tested across all served x producer combinations.

Fixes #593

Signed-off-by: badbread <badbread@users.noreply.github.com>
@badbread
badbread merged commit 4aebef1 into main Aug 25, 2026
7 checks passed
@badbread
badbread deleted the fix/fmtp-repair-gaps branch August 25, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

main/sub fmtp-repair gaps surfaced by #592: record-from-sub blindness + sub-side incomplete fmtp

1 participant