Skip to content

pcaputil: Improve silence gap fill logic#4785

Draft
orgads wants to merge 2 commits intopjsip:masterfrom
audiocodes:pcap-gaps
Draft

pcaputil: Improve silence gap fill logic#4785
orgads wants to merge 2 commits intopjsip:masterfrom
audiocodes:pcap-gaps

Conversation

@orgads
Copy link
Contributor

@orgads 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

@orgads orgads force-pushed the pcap-gaps branch 2 times, most recently from 09471d3 to 22b87b8 Compare February 10, 2026 15:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@orgads orgads force-pushed the pcap-gaps branch 2 times, most recently from b93f5dd to 670d9be Compare February 13, 2026 11:15
@orgads orgads requested a review from Copilot February 13, 2026 11:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

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.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

@orgads orgads marked this pull request as draft February 14, 2026 21:03
@orgads
Copy link
Contributor Author

orgads commented Feb 14, 2026

I have some more improvements, mostly readability issues. Changed to draft for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants