echo-cancel: Don't process if sink is unconnected

If there's no playback data, there's no point in actually processing the
capture data.
This commit is contained in:
Arun Raghavan 2011-10-12 13:04:57 +05:30
parent 89f00f3e4c
commit 4bd357ae57

View 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;
}