Skip to content

fix: VAD time mapping timestamp drift caused by overlap samples#3711

Merged
danbev merged 2 commits into
ggml-org:masterfrom
lohopupa:fix/vad-end-mappings
Mar 17, 2026
Merged

fix: VAD time mapping timestamp drift caused by overlap samples#3711
danbev merged 2 commits into
ggml-org:masterfrom
lohopupa:fix/vad-end-mappings

Conversation

@lohopupa

Copy link
Copy Markdown
Contributor

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.

Lohopupa 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.
@ggerganov ggerganov requested a review from danbev March 16, 2026 16:30

@danbev danbev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@lohopupa Thanks!

@danbev danbev merged commit dc96116 into ggml-org:master Mar 17, 2026
67 checks passed
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>
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.

Bug: vad_end mapping incorrectly includes overlap samples, causing timestamp drift and redundant mapping points

2 participants