echo-cancel: Don't process if sink is unconnected
authorArun Raghavan <arun.raghavan@collabora.co.uk>
Wed, 12 Oct 2011 07:34:57 +0000 (13:04 +0530)
committerArun Raghavan <arun.raghavan@collabora.co.uk>
Wed, 12 Oct 2011 07:34:57 +0000 (13:04 +0530)
If there's no playback data, there's no point in actually processing the
capture data.

src/modules/echo-cancel/module-echo-cancel.c

index b1fa791..a96ef37 100644 (file)
@@ -657,7 +657,8 @@ static void source_output_push_cb(pa_source_output *o, const pa_memchunk *chunk)
         return;
     }
 
-    if (PA_UNLIKELY(u->source->thread_info.state != PA_SOURCE_RUNNING)) {
+    if (PA_UNLIKELY(u->source->thread_info.state != PA_SOURCE_RUNNING ||
+                    u->sink->thread_info.state != PA_SINK_RUNNING)) {
         pa_source_post(u->source, chunk);
         return;
     }