From 71a8b2e7bc4fd1f9cc7c7ff527c518dcd4d088f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 10 Aug 2007 05:51:40 +0000 Subject: [PATCH] gst/filter/gstbpwsinc.c: Fix a segfault with more than one channel and don't rebuild the kernel & residue with every ... Original commit message from CVS: * gst/filter/gstbpwsinc.c: (bpwsinc_build_kernel): Fix a segfault with more than one channel and don't rebuild the kernel & residue with every buffer. --- gst/audiofx/audiowsincband.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gst/audiofx/audiowsincband.c b/gst/audiofx/audiowsincband.c index dcf7c68f14..d6bb3d12d6 100644 --- a/gst/audiofx/audiowsincband.c +++ b/gst/audiofx/audiowsincband.c @@ -313,6 +313,8 @@ bpwsinc_build_kernel (GstBPWSinc * self) return; } + self->have_kernel = TRUE; + /* Clamp frequencies */ self->lower_frequency = CLAMP (self->lower_frequency, 0.0, @@ -412,7 +414,8 @@ bpwsinc_build_kernel (GstBPWSinc * self) if (self->residue) g_free (self->residue); - self->residue = g_new0 (gdouble, len); + self->residue = + g_new0 (gdouble, len * GST_AUDIO_FILTER (self)->format.channels); } /* GstAudioFilter vmethod implementations */