audioecho: make sure buffer gets reallocated if max_delay changes
authorPrashant Gotarne <ps.gotarne@samsung.com>
Fri, 14 Aug 2015 04:06:09 +0000 (09:36 +0530)
committerTim-Philipp Müller <tim@centricular.com>
Fri, 14 Aug 2015 10:50:22 +0000 (11:50 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=753490

gst/audiofx/audioecho.c

index 8023827..769994b 100644 (file)
@@ -200,6 +200,10 @@ gst_audio_echo_set_property (GObject * object, guint prop_id,
       } else {
         self->delay = delay;
         self->max_delay = MAX (delay, max_delay);
+        if (delay > max_delay) {
+          g_free (self->buffer);
+          self->buffer = NULL;
+        }
       }
       rate = GST_AUDIO_FILTER_RATE (self);
       if (rate > 0)
@@ -220,6 +224,8 @@ gst_audio_echo_set_property (GObject * object, guint prop_id,
             " PLAYING or PAUSED state");
       } else {
         self->max_delay = max_delay;
+        g_free (self->buffer);
+        self->buffer = NULL;
       }
       g_mutex_unlock (&self->lock);
       break;