audiomixer: only overwrite OK status

When the mixer has no bytes queued, only ask for more bytes when
we were in the OK status otherwise we might override the HAVE_BUFFER
status and discard the queued buffer.
This commit is contained in:
Wim Taymans 2018-01-30 14:53:38 +01:00
parent 01d8fdc1bf
commit 95b3cba3c3

View file

@ -1049,15 +1049,14 @@ static int impl_node_process_output(struct spa_node *node)
if ((inio = inport->io) == NULL || inport->n_buffers == 0)
continue;
if (inport->queued_bytes == 0) {
spa_log_trace(this->log, NAME " %p: port %d queued %zd, res %d", this,
i, inport->queued_bytes, inio->status);
if (inport->queued_bytes == 0 && inio->status == SPA_STATUS_OK) {
if (inport->io_range && outport->io_range)
*inport->io_range = *outport->io_range;
inio->status = SPA_STATUS_NEED_BUFFER;
} else {
inio->status = SPA_STATUS_OK;
}
spa_log_trace(this->log, NAME " %p: port %d queued %zd, res %d", this,
i, inport->queued_bytes, inio->status);
}
}
return outio->status;