Commit c884a3b3 authored by Luis de Bethencourt's avatar Luis de Bethencourt

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.
parent 476f9957
......@@ -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,
equ->need_new_coefficients = TRUE;
band->gain = gain;
set_passthrough (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)
if (need_new_coefficients) {
update_coefficients (equ);
set_passthrough (equ);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment