audioecho: Fix handling of delay property in PLAYING/PAUSED state

https://bugzilla.gnome.org/show_bug.cgi?id=703901
This commit is contained in:
Kyosuke Nekomura 2013-07-12 03:24:08 +08:00 committed by Sebastian Dröge
parent 3aa20e7c8d
commit 4d517e94ef

View file

@ -187,6 +187,7 @@ gst_audio_echo_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_DELAY:{
guint64 max_delay, delay;
guint rate;
g_mutex_lock (&self->lock);
delay = g_value_get_uint64 (value);
@ -201,6 +202,11 @@ gst_audio_echo_set_property (GObject * object, guint prop_id,
self->delay = delay;
self->max_delay = MAX (delay, max_delay);
}
rate = GST_AUDIO_FILTER_RATE (self);
if (rate > 0)
self->delay_frames =
MAX (gst_util_uint64_scale (self->delay, rate, GST_SECOND), 1);
g_mutex_unlock (&self->lock);
break;
}