audiofxbasefirfilter: Fix time-domain convolution with >1 channels
authorSebastian Dröge <sebastian@centricular.com>
Tue, 12 May 2015 10:41:58 +0000 (13:41 +0300)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 12 May 2015 10:41:58 +0000 (13:41 +0300)
input_samples is the number of frames, but we used it as the number of
samples.

https://bugzilla.gnome.org/show_bug.cgi?id=747204

gst/audiofx/audiofxbasefirfilter.c

index 6af55f7..ccafb0a 100644 (file)
@@ -116,6 +116,7 @@ process_##channels##_##width (GstAudioFXBaseFIRFilter * self, const g##ctype * s
     self->buffer = buffer = g_new0 (gdouble, self->buffer_length); \
   } \
   \
+  input_samples *= channels; \
   /* convolution */ \
   for (i = 0; i < input_samples; i++) { \
     dst[i] = 0.0; \
@@ -155,7 +156,7 @@ process_##channels##_##width (GstAudioFXBaseFIRFilter * self, const g##ctype * s
   if (self->buffer_fill > kernel_length) \
     self->buffer_fill = kernel_length; \
   \
-  return input_samples; \
+  return input_samples / channels; \
 } G_STMT_END
 
 DEFINE_PROCESS_FUNC (32, float);