mirror of
https://github.com/ggerganov/whisper.cpp.git
synced 2025-01-01 03:28:57 +01:00
whisper : fix sample_to_timestamp calculation with 64 bit precision to avoid overflow (#388)
* Do calculation with 64 bit precision to avoid overflow * Update whisper.cpp Co-authored-by: Georgi Gerganov <ggerganov@gmail.com> Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
This commit is contained in:
parent
1512545149
commit
08dc705a69
@ -3388,7 +3388,7 @@ static int timestamp_to_sample(int64_t t, int n_samples) {
|
||||
}
|
||||
|
||||
static int64_t sample_to_timestamp(int i_sample) {
|
||||
return (100*i_sample)/WHISPER_SAMPLE_RATE;
|
||||
return (100ll*i_sample)/WHISPER_SAMPLE_RATE;
|
||||
}
|
||||
|
||||
// a cost-function / heuristic that is high for text that takes longer to pronounce
|
||||
|
Loading…
Reference in New Issue
Block a user