From c884a3b3a5569aa8ada440e423b90618b74b01ab Mon Sep 17 00:00:00 2001 From: Luis de Bethencourt Date: Tue, 21 Apr 2015 16:34:21 +0100 Subject: [PATCH] equalizer: fix dynamic changes on bands When we are in passthrough, the transform function doesn't run and if the passthrough check is in this function it will never be deactivated. Fix this by checking directly whenever a gain is changed. Also set the passthrough to TRUE at init because the gains default to 0, so we can passthrough until any gain property is changed. https://bugzilla.gnome.org/show_bug.cgi?id=748068 --- gst/equalizer/gstiirequalizer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gst/equalizer/gstiirequalizer.c b/gst/equalizer/gstiirequalizer.c index e912ca5..eb23d21 100644 --- a/gst/equalizer/gstiirequalizer.c +++ b/gst/equalizer/gstiirequalizer.c @@ -49,6 +49,7 @@ static gboolean gst_iir_equalizer_setup (GstAudioFilter * filter, const GstAudioInfo * info); static GstFlowReturn gst_iir_equalizer_transform_ip (GstBaseTransform * btrans, GstBuffer * buf); +static void set_passthrough (GstIirEqualizer * equ); #define ALLOWED_CAPS \ "audio/x-raw," \ @@ -159,6 +160,7 @@ gst_iir_equalizer_band_set_property (GObject * object, guint prop_id, BANDS_LOCK (equ); equ->need_new_coefficients = TRUE; band->gain = gain; + set_passthrough (equ); BANDS_UNLOCK (equ); GST_DEBUG_OBJECT (band, "changed gain = %lf ", band->gain); } @@ -373,7 +375,8 @@ static void gst_iir_equalizer_init (GstIirEqualizer * eq) { g_mutex_init (&eq->bands_lock); - eq->need_new_coefficients = TRUE; + /* Band gains are 0 by default, passthrough until they are changed */ + gst_base_transform_set_passthrough (GST_BASE_TRANSFORM (eq), TRUE); } static void @@ -852,7 +855,6 @@ gst_iir_equalizer_transform_ip (GstBaseTransform * btrans, GstBuffer * buf) BANDS_LOCK (equ); if (need_new_coefficients) { update_coefficients (equ); - set_passthrough (equ); } BANDS_UNLOCK (equ); -- 2.7.4