Do not send Sender Reports before any RTP has been sent - #461
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #461 +/- ##
==========================================
+ Coverage 81.29% 81.46% +0.16%
==========================================
Files 91 91
Lines 4683 4688 +5
==========================================
+ Hits 3807 3819 +12
+ Misses 696 693 -3
+ Partials 180 176 -4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
tmatth
force-pushed
the
sr-before-first-packet
branch
3 times, most recently
from
September 14, 2026 23:33
3dc8642 to
a17959d
Compare
mengelbart
reviewed
Sep 15, 2026
mengelbart
left a comment
Contributor
There was a problem hiding this comment.
Thanks, I think this makes sense.
JoTurk
approved these changes
Sep 15, 2026
JoTurk
left a comment
Member
There was a problem hiding this comment.
Looks good, I agree with @mengelbart comments
tmatth
force-pushed
the
sr-before-first-packet
branch
from
September 15, 2026 12:52
a17959d to
07c51b3
Compare
The sender report interceptor emitted an SR for every bound stream on each tick, including streams that had not written a single packet. For those the RTP timestamp was derived from a zero time.Time, so the report mapped "now" to a garbage timestamp (2269117121 at 90 kHz, 923864645 at 48 kHz). RFC 3550 6.4 says a source that has sent nothing sends an RR, which the receiver interceptor already does. Receivers that anchor RTCP-based timing on the first SR they see (for example OvenMediaEngine with RtcpBasedTimestamp) then have their anchor jump when the first real SR arrives a second later, and the stream can be stuck with a PTS that moved backwards by hours. Skip streams with no packets sent when generating reports. The two existing subtests that relied on an SR before any RTP are adjusted: "before any packet" now asserts nothing is written, and "inject ticker" writes one RTP packet before ticking.
Cover the transition directly: a tick before any RTP writes nothing, and the first tick after one RTP packet writes an SR whose RTPTime is that packet's timestamp.
tmatth
force-pushed
the
sr-before-first-packet
branch
from
September 15, 2026 13:05
07c51b3 to
71b9984
Compare
mengelbart
approved these changes
Sep 15, 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.
The sender report interceptor emitted an SR for every bound stream on each tick, including streams that had not written a single packet. For those the RTP timestamp was derived from a zero
time.Time, so the report mapped "now" to a garbage timestamp (2269117121 at 90 kHz, 923864645 at 48 kHz).RFC 3550 6.4says a source that has sent nothing sends an RR, which the receiver interceptor already does.Receivers that anchor RTCP-based timing on the first SR they see (for example
OvenMediaEnginewithRtcpBasedTimestamp) then have their anchor jump when the first real SR arrives a second later, and the stream can be stuck with a PTS that moved backwards by hours.Skip streams with no packets sent when generating reports. The two existing subtests that relied on an SR before any RTP are adjusted: "before any packet" now asserts nothing is written, and "inject ticker" writes one RTP packet before ticking.
This PR also adds a test specifically for this transition.