From a2521bb3e0cfd516519719e625ecc846b6025c47 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 1 Jul 2022 21:49:13 +0200 Subject: [PATCH] audioconvert: fix draining When we get something else that a drain status as input, bring us back to the non-drained state. When we are draining, don't remove the drained flag on the input io status. This needs to be cleared by the host when the draining is finished. Fixes speaker-test --- spa/plugins/audioconvert/audioconvert.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spa/plugins/audioconvert/audioconvert.c b/spa/plugins/audioconvert/audioconvert.c index 21a7ffea1..e5687cdf2 100644 --- a/spa/plugins/audioconvert/audioconvert.c +++ b/spa/plugins/audioconvert/audioconvert.c @@ -2252,6 +2252,7 @@ static int impl_node_process(void *object) spa_log_trace_fp(this->log, "%p: empty input port %d %p %d %d %d", this, port->id, io, io->status, io->buffer_id, port->n_buffers); + this->drained = false; } buf = NULL; } else if (SPA_UNLIKELY(io->buffer_id >= port->n_buffers)) { @@ -2531,7 +2532,8 @@ static int impl_node_process(void *object) if (SPA_UNLIKELY((io = port->io) == NULL)) continue; spa_log_trace_fp(this->log, "return: input %d %d", port->id, io->buffer_id); - io->status = SPA_STATUS_NEED_DATA; + if (!draining) + io->status = SPA_STATUS_NEED_DATA; } this->in_offset = 0; max_in = 0;