Skip to content

Conversation

@boks1971
Copy link

Description

When a compound RTCP packet is received, it is forwarded as is to the read streams. Downstream components have to check for the SSRC in the packets matching the track(s) it is handling.

This leads to situations where downstream components could see duplicate RTCP reports. Happens when there is a downstream handler for all SSRCs. It receives the compound packet, unmarshals it and invokes the handlers. As it is fielding all SSRCs, it will get the same compound packet n times and invoke the handlers n times.

This PR splits up the compound packet and forwards individual packets to avoid the end handlers from seeing duplicates. API wise, it is compatible as it still emits an encoded/marshaled packet. But, this does add a marshaling step.

Add an unit test. Before this change, the test fails at the point where the test tries to read the CNAME packet and sees an incorrect type.

@boks1971 boks1971 requested review from JoTurk and Sean-Der December 29, 2025 04:25
@codecov
Copy link

codecov bot commented Dec 29, 2025

Codecov Report

❌ Patch coverage is 50.00000% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.54%. Comparing base (1156dbf) to head (40818b0).

Files with missing lines Patch % Lines
session_srtcp.go 50.00% 5 Missing and 6 partials ⚠️

❌ Your patch check has failed because the patch coverage (50.00%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #359      +/-   ##
==========================================
- Coverage   82.64%   82.54%   -0.11%     
==========================================
  Files          19       19              
  Lines        1458     1461       +3     
==========================================
+ Hits         1205     1206       +1     
- Misses        140      141       +1     
- Partials      113      114       +1     
Flag Coverage Δ
go 82.54% <50.00%> (-0.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@boks1971 boks1971 force-pushed the raja_srtp_compound branch 6 times, most recently from ff4a028 to 6faec8e Compare December 29, 2025 06:04
When a compound RTCP packet is received, it is forwarded as is to the
read streams. Downstream components have to check for the SSRC in the
packets matching the track(s) it is handling.

This leads to situations where downstream components could see duplicate
RTCP reports. Happens when there is a downstream handler for all SSRCs.
It receives the compound packet, unmarshals it and invokes the handlers.
As it is fielding all SSRCs, it will get the same compound packet `n`
times and invoke the handlers `n` times.

This PR splits up the compound packet and forwards individual packets to
avoid the end handlers from seeing duplicates. API wise, it is
compatible as it still emits an encoded/marshaled packet. But, this does
add a marshaling step.

Add an unit test. Before this change, the test fails at the point where
the test tries to read the CNAME packet and sees an incorrect type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants