[pulseaudio-commits] src/modules

Arun Raghavan arun at kemper.freedesktop.org
Sun Aug 17 20:18:46 PDT 2014


 src/modules/echo-cancel/module-echo-cancel.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 6fdddf45f74859381b2099149e4f5888d5464274
Author: Arun Raghavan <arun at accosted.net>
Date:   Mon Aug 4 13:51:48 2014 +0530

    echo-cancel: Fix drift timer restart logic across suspend
    
    The IS_ACTIVE() macro does a pa_sink/source_get_state() on our sink and
    source, which does not work in the state change callback, since the
    state is not actually committed at that point.

diff --git a/src/modules/echo-cancel/module-echo-cancel.c b/src/modules/echo-cancel/module-echo-cancel.c
index 9df2899..62429fd 100644
--- a/src/modules/echo-cancel/module-echo-cancel.c
+++ b/src/modules/echo-cancel/module-echo-cancel.c
@@ -475,7 +475,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 */
-        if (IS_ACTIVE(u) && u->adjust_time)
+        if ((pa_sink_get_state(u->sink) == PA_SINK_RUNNING) && 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);
@@ -500,7 +500,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 */
-        if (IS_ACTIVE(u) && u->adjust_time)
+        if ((pa_source_get_state(u->source) == PA_SOURCE_RUNNING) && 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);



More information about the pulseaudio-commits mailing list