From 193270ee87d8e5a4b193d36ae50d29a4f0038c6d Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Fri, 18 Nov 2022 12:50:55 +0100 Subject: [PATCH] avfilter/avf_showspectrum: fix stride and set scale --- libavfilter/avf_showspectrum.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c index 8e9597cdf6..da7c186326 100644 --- a/libavfilter/avf_showspectrum.c +++ b/libavfilter/avf_showspectrum.c @@ -470,7 +470,7 @@ static int run_channel_fft(AVFilterContext *ctx, void *arg, int jobnr, int nb_jo } memcpy(f, g, s->buf_size * sizeof(*f)); - s->itx_fn(s->ifft[ch], g, f, sizeof(float)); + s->itx_fn(s->ifft[ch], g, f, sizeof(AVComplexFloat)); for (int k = 0; k < M; k++) { psi = k * k / 2.f * phi; @@ -1146,7 +1146,7 @@ static int config_output(AVFilterLink *outlink) s->nb_display_channels = inlink->ch_layout.nb_channels; for (i = 0; i < s->nb_display_channels; i++) { - float scale; + float scale = 1.f; ret = av_tx_init(&s->fft[i], &s->tx_fn, AV_TX_FLOAT_FFT, 0, fft_size << (!!s->stop), &scale, 0); if (s->stop) {