summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Raghavan <arun.raghavan@collabora.co.uk>2011-10-06 14:36:50 +0530
committerArun Raghavan <arun.raghavan@collabora.co.uk>2011-10-10 13:35:57 +0530
commit8a5e6e8356254b9b81093bb2ab131b83d3df15d0 (patch)
treea371c9a4f2aa6a04b1f63731a722554dc64bed64
parent346fd7066c560eed52e4c4a2293266366122e120 (diff)
echo-cancel: Don't crash if adjust_time = 0
-rw-r--r--src/modules/echo-cancel/module-echo-cancel.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/echo-cancel/module-echo-cancel.c b/src/modules/echo-cancel/module-echo-cancel.c
index 89638b73..97df0b15 100644
--- a/src/modules/echo-cancel/module-echo-cancel.c
+++ b/src/modules/echo-cancel/module-echo-cancel.c
@@ -405,7 +405,7 @@ static int source_set_state_cb(pa_source *s, pa_source_state_t state) {
if (state == PA_SOURCE_RUNNING) {
/* restart timer when both sink and source are active */
u->active_mask |= 1;
- if (u->active_mask == 3)
+ if (u->active_mask == 3 && u->adjust_time)
pa_core_rttime_restart(u->core, u->time_event, pa_rtclock_now() + u->adjust_time);
pa_atomic_store(&u->request_resync, 1);
@@ -433,7 +433,7 @@ static int sink_set_state_cb(pa_sink *s, pa_sink_state_t state) {
if (state == PA_SINK_RUNNING) {
/* restart timer when both sink and source are active */
u->active_mask |= 2;
- if (u->active_mask == 3)
+ if (u->active_mask == 3 && u->adjust_time)
pa_core_rttime_restart(u->core, u->time_event, pa_rtclock_now() + u->adjust_time);
pa_atomic_store(&u->request_resync, 1);