Synchronizer: add explicit sender report sync modes and one-shot drift correction#865
Merged
Synchronizer: add explicit sender report sync modes and one-shot drift correction#865
Conversation
…t correction This change introduces an explicit sender report sync mode model in the synchronizer and adds a new one-shot drift correction path for mixer-oriented pipelines. The main motivation is SIP silence suppression (which frequently doesn't get signalled properly) drift in room composite recordings. In that scenario, RTP timestamps can remain continuous while wall clock time advances much faster, which means the existing silence gap handling does not trigger. Over time, the audio track falls behind the mixer window and samples get dropped before the late correction path kicks in.
boks1971
approved these changes
Mar 24, 2026
biglittlebigben
approved these changes
Mar 24, 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.
This change introduces an explicit sender report sync mode model in the synchronizer and adds a new one-shot drift correction path for mixer-oriented pipelines.
The main motivation is SIP silence suppression (which frequently doesn't get signaled properly) drift in room composite recordings. In that scenario, RTP timestamps can remain continuous while wall clock time advances much faster, which means the existing silence gap handling does not trigger. Over time, the audio track falls behind the mixer window and samples get dropped before the late correction path kicks in.
To address that, this PR adds a one-shot correction mode that:
This keeps normal packet PTS generation stable while still allowing the synchronizer to recover before the track falls out of the mixer’s live window.
What changed
Added explicit SenderReportSyncMode values:
Kept legacy APIs for compatibility:
Refactored track logic to branch on sync mode instead of implicit boolean combinations
In one-shot mode:
This PR preserves existing behavior by default:
if nothing is configured, synchronizer stays on the legacy without_rebase path legacy rebase option still works.
WithAudioPTSAdjustmentDisabled() remains available because it is still needed to suppress audio SR-driven drift action in the legacy non-rebased path.
One-shot mode is opt-in and requires explicit configuration.
Why this shape
The previous option surface made it easy to end up with ambiguous combinations such as “rebase enabled + one-shot threshold + audio adjustment disabled”. This PR makes the behavior mode-based instead of relying on interacting booleans.
That should make it clearer which SR path is used, how drift is measured, and how drift is applied.