Skip to content

Fix jitter calculation to match RFC3550 and convert to seconds#352

Merged
kevmo314 merged 1 commit intopion:masterfrom
yannismate:jitter-fix
Aug 17, 2025
Merged

Fix jitter calculation to match RFC3550 and convert to seconds#352
kevmo314 merged 1 commit intopion:masterfrom
yannismate:jitter-fix

Conversation

@yannismate
Copy link
Contributor

Description

The previous jitter calculation was not following RFC3550 and reported incorrect values, as can be seen in the first modified test which reports a high jitter despite all packets arriving perfectly spaced (in both RTP timestamp and Pion receival timestamp).
Additionally, other implementations report the jitter in seconds instead of RTP timestamp units which are dependent on the streams clock rate, which should now also be the case here.

Reference issue

Fixes #234

@yannismate
Copy link
Contributor Author

I rebased onto the current master branch which should hopefully fix the linter issue

@codecov
Copy link

codecov bot commented Aug 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.60%. Comparing base (e2c357c) to head (4e37ab2).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #352      +/-   ##
==========================================
- Coverage   78.70%   78.60%   -0.10%     
==========================================
  Files          82       82              
  Lines        5165     5169       +4     
==========================================
- Hits         4065     4063       -2     
- Misses        927      931       +4     
- Partials      173      175       +2     
Flag Coverage Δ
go 78.60% <100.00%> (-0.10%) ⬇️
wasm 76.10% <100.00%> (-0.04%) ⬇️

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.

@kevmo314
Copy link

This change seems reasonable to me, thanks!

@kevmo314 kevmo314 merged commit 467444d into pion:master Aug 17, 2025
14 checks passed
@yannismate yannismate deleted the jitter-fix branch August 17, 2025 14:18
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.

[stats] jitter should be measured in seconds

2 participants