Skip to content

Commit 1591558

Browse files
authored
whisper : clear result_all if vad_samples is empty (#3262)
This commit clears the results_all vector no VAD segments are found. The motivation for this is that this would normally be done by `whisper_full_with_state` but when no VAD segments are detected this current implementation does not call that function and hence the vector does not get reset. This can lead to issues in applications like the server example where it will incorrectly process the old results. Resolves: #3250
1 parent f3ff80e commit 1591558

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/whisper.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7724,6 +7724,7 @@ int whisper_full(
77247724
return -1;
77257725
}
77267726
if (vad_samples.empty()) {
7727+
ctx->state->result_all.clear();
77277728
return 0;
77287729
}
77297730
samples = vad_samples.data();

0 commit comments

Comments
 (0)