]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
mtmd: fix whisper audio tail truncation by exposing padded buffer to FFT (#22770)
authorPascal <redacted>
Thu, 7 May 2026 12:01:01 +0000 (14:01 +0200)
committerGitHub <redacted>
Thu, 7 May 2026 12:01:01 +0000 (14:01 +0200)
tools/mtmd/mtmd-audio.cpp

index 6bab1b6be9179b6173ccf839331e3d9869b9895f..8f0a9875b1043fff88a281bd95a34111bbd45ad2 100644 (file)
@@ -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