fix: VAD time mapping timestamp drift caused by overlap samples#3711
Merged
Conversation
added 2 commits
March 16, 2026 20:51
- Use original segment length (pre-overlap) for vad_end in the time mapping table, so segment boundaries are preserved accurately Claude Sonnet 4.6 (Low)
Now that segment boundaries are mapped accurately, the intermediate point interpolation is no longer necessary.
danbev
approved these changes
Mar 17, 2026
DakodaStemen
pushed a commit
to DakodaStemen/whisper.cpp
that referenced
this pull request
Mar 24, 2026
…-org#3711) * whisper : fix VAD segment overlap boundary handling - Use original segment length (pre-overlap) for vad_end in the time mapping table, so segment boundaries are preserved accurately Claude Sonnet 4.6 (Low) * whisper : remove intermediate VAD time mapping points Now that segment boundaries are mapped accurately, the intermediate point interpolation is no longer necessary. --------- Co-authored-by: Lohopupa <lohopupa@gmail.com>
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.
Fixes #3683
segment.vad_end was incorrectly calculated using the overlap-extended segment length, while segment.orig_end used the original VAD boundary. This ratio mismatch caused timestamp drift in the mapping table.
This PR fixes vad_end to use the original segment length before overlap is applied, establishing a correct 1:1 VAD-to-original time ratio. The overlap clamping is also moved to happen after the original length is recorded, preventing potential out-of-bounds reads.
With correct mappings, intermediate interpolation points carry no new information and have been removed - tested on a several audio files with or without the points the output is the same. The only mapping differences observed are due to the corrected vad_end values themselves.