From: Pascal Date: Thu, 7 May 2026 12:01:01 +0000 (+0200) Subject: mtmd: fix whisper audio tail truncation by exposing padded buffer to FFT (#22770) X-Git-Tag: upstream/0.0.10438~1382 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=cc97e45a1418fa9f63a34ceafcf4aa4c01fbdd0d;p=pkg%2Fggml%2Fsources%2Fllama.cpp mtmd: fix whisper audio tail truncation by exposing padded buffer to FFT (#22770) --- diff --git a/tools/mtmd/mtmd-audio.cpp b/tools/mtmd/mtmd-audio.cpp index 6bab1b6be..8f0a9875b 100644 --- a/tools/mtmd/mtmd-audio.cpp +++ b/tools/mtmd/mtmd-audio.cpp @@ -403,6 +403,11 @@ static bool log_mel_spectrogram( return false; } std::reverse_copy(samples + 1, samples + 1 + stage_2_pad, samples_padded.begin()); + + // expose the padded buffer to downstream FFT and to out.n_len computation + // mirrors the no_padding and center_padding branches above + samples = samples_padded.data(); + n_samples = samples_padded.size(); } // preemphasis