jitter: shorten the restart run when it starts beyond the reorder window - #86
Merged
hechen-eng merged 1 commit intoSep 25, 2026
Merged
Conversation
Contributor
|
within the window is probably not gonna fix everything. We do see traffic that restarts sn but still within range. #95 |
Contributor
A sender that re-anchors its sequence far behind prevSN (a PBX transfer on the same SSRC: 21294 -> 12676 on a captured call) cannot be sending late packets, yet it still waited out the full 20-packet sequenceRestartRun. A run whose first expired packet is outside withinRange of prevSN now needs only farSequenceRestartRun (2): one packet lost instead of 19, while a lone stale packet still cannot rewind the stream. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ahsang
force-pushed
the
fix/jitter-backward-discontinuity
branch
from
September 23, 2026 20:49
6df53d3 to
902b037
Compare
hechen-eng
approved these changes
Sep 25, 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.
Summary
Rebased on #93 / #95 as suggested. This is now a small change to
sequenceRestart.prevSNstill had to wait out the fullsequenceRestartRun(20). On a captured PBX transfer (same SSRC, 21294 → 12676) that is ~380 ms of dropped audio for packets that cannot be late: they are 8618 behind, well outside the 3000-packet reorder window.withinRange(sn, prevSN), the run only needsfarSequenceRestartRun(2). The resync still goes throughrestartStream(), soSequenceRestarts, the flush and the drop counters are unchanged.TestSequenceRestart/TestSequenceRestartFalsePositiveare unaffected.Tests
TestSequenceRestartFar: the captured jump. It resyncs after 1 dropped packet. On main it drops 19.TestSequenceRestartFarStray: a lone far-behind packet is dropped and the live stream carries on with no restart.go test -race ./jitter/passes. (TestResamplein the root package fails under-raceon main too. It is unrelated.)Related
🤖 Generated with Claude Code