pcaputil: Improve silence gap fill logic#4785
Draft
orgads wants to merge 2 commits intopjsip:masterfrom
Draft
Conversation
Contributor
orgads
commented
Feb 10, 2026
- Do not fill silence gap when frame timestamp gap is too short
- Use pcap wall-clock gap when RTP timestamps understate pause
09471d3 to
22b87b8
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the silence gap fill logic in pcaputil by addressing timing discrepancies between RTP timestamps and actual wall-clock time. The changes ensure more accurate silence filling during pauses in audio streams.
Changes:
- Introduces a minimum threshold (150ms) to detect when wall-clock gaps significantly exceed RTP timestamp gaps
- Adjusts gap calculation to use pcap wall-clock timestamps when RTP timestamps understate actual pauses
- Adds validation to prevent gap-filling when timestamp discontinuities indicate non-real pauses
b93f5dd to
670d9be
Compare
Some systems have discrepancies in RTP header timestamp, while the packet timestamp diff is 20ms. Try to detect these cases and do not fill silence for them.
When the marker bit indicates a new talkspurt, RTP timestamps may not reflect the actual pause duration (e.g. during hold). If the pcap wall-clock gap exceeds the RTP timestamp gap by more than 150ms (a jitter buffer to tolerate clock drift and network jitter), substitute the wall-clock gap so silence is filled correctly.
Contributor
Author
|
I have some more improvements, mostly readability issues. Changed to draft for now. |
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.