echo-cancel: reuse buffer on error

Queue the dequeued buffers when there is an error so that we can
recover.
This commit is contained in:
Wim Taymans 2021-05-31 15:53:34 +02:00
parent b0068fd46b
commit 8485622923

View file

@ -147,7 +147,7 @@ static void process(struct impl *impl)
pw_log_warn("out of playback buffers: %m"); pw_log_warn("out of playback buffers: %m");
if (cin == NULL || cout == NULL || pin == NULL || pout == NULL) if (cin == NULL || cout == NULL || pin == NULL || pout == NULL)
return; goto done;
for (i = 0; i < impl->info.channels; i++) { for (i = 0; i < impl->info.channels; i++) {
/* captured samples, with echo from sink */ /* captured samples, with echo from sink */
@ -178,9 +178,14 @@ static void process(struct impl *impl)
} }
echo_cancel_run(impl->aec_info, impl->aec, rec, play, out, size / sizeof(float)); echo_cancel_run(impl->aec_info, impl->aec, rec, play, out, size / sizeof(float));
done:
if (cin != NULL)
pw_stream_queue_buffer(impl->capture, cin); pw_stream_queue_buffer(impl->capture, cin);
if (cout != NULL)
pw_stream_queue_buffer(impl->source, cout); pw_stream_queue_buffer(impl->source, cout);
if (pin != NULL)
pw_stream_queue_buffer(impl->sink, pin); pw_stream_queue_buffer(impl->sink, pin);
if (pout != NULL)
pw_stream_queue_buffer(impl->playback, pout); pw_stream_queue_buffer(impl->playback, pout);
impl->sink_ready = false; impl->sink_ready = false;