diff options
author | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2011-09-29 12:49:11 +0530 |
---|---|---|
committer | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2011-10-10 13:26:06 +0530 |
commit | cee60115720e3e96062e35f0d7ee2ff4e531e6b7 (patch) | |
tree | 1b886823f90f2f0be57a0c43a649a9ab22bdfa8c | |
parent | 4cacb1b670f61650d0b5495b59359fae00e6e497 (diff) |
echo-cancel: Skip canceller when no source outputs are connected
When a source-output isn't connected to our virtual source, we skip echo
cancellation altogether. This makes sense in general, and makes sure
that we don't end up adjusting for delay/drift when nothing is
connected. This should make convergence faster when the canceller
actually starts being used.
-rw-r--r-- | src/modules/echo-cancel/module-echo-cancel.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/modules/echo-cancel/module-echo-cancel.c b/src/modules/echo-cancel/module-echo-cancel.c index a3e7e0d59..8d77a3b2b 100644 --- a/src/modules/echo-cancel/module-echo-cancel.c +++ b/src/modules/echo-cancel/module-echo-cancel.c @@ -656,6 +656,11 @@ 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)) { + pa_source_post(u->source, chunk); + return; + } + /* handle queued messages, do any message sending of our own */ while (pa_asyncmsgq_process_one(u->asyncmsgq) > 0) ; @@ -852,7 +857,7 @@ static int source_output_process_msg_cb(pa_msgobject *obj, int code, void *data, pa_source_output_assert_io_context(u->source_output); - if (PA_SOURCE_IS_OPENED(u->source_output->source->thread_info.state)) + if (u->source_output->source->thread_info.state == PA_SOURCE_RUNNING) pa_memblockq_push_align(u->sink_memblockq, chunk); else pa_memblockq_flush_write(u->sink_memblockq, TRUE); |