--- audioecho.c.old	2012-10-25 18:55:46.000000000 +0800
+++ audioecho.c	2013-07-10 03:36:20.910898209 +0800
@@ -187,7 +187,8 @@
   switch (prop_id) {
     case PROP_DELAY:{
       guint64 max_delay, delay;
-
+      guint rate;
+      
       g_mutex_lock (&self->lock);
       delay = g_value_get_uint64 (value);
       max_delay = self->max_delay;
@@ -201,6 +202,12 @@
         self->delay = delay;
         self->max_delay = MAX (delay, max_delay);
       }
+      
+      //Reset the buffer and update delay frame number if delay value has changed.
+      rate = GST_AUDIO_FILTER_RATE (self);
+      self->delay_frames = MAX (gst_util_uint64_scale (self->delay, rate, GST_SECOND), 1);
+      self->buffer_pos = 0; 
+            
       g_mutex_unlock (&self->lock);
       break;
     }
