audioadapter: loop until we have data

Keep caling the slave processing function until we have data from
the converter or until no process can be made.
This commit is contained in:
Wim Taymans 2019-12-17 15:11:31 +01:00
parent 58a7e18ed5
commit d67d012362
2 changed files with 11 additions and 4 deletions

View file

@ -875,12 +875,19 @@ static int impl_node_process(void *object)
status = spa_node_process(this->convert);
}
again:
status = spa_node_process(this->slave);
if (this->direction == SPA_DIRECTION_OUTPUT && !this->master) {
if (this->use_converter)
status = spa_node_process(this->convert);
if (this->direction == SPA_DIRECTION_OUTPUT &&
!this->master && this->use_converter) {
status = spa_node_process(this->convert);
if (!(status & SPA_STATUS_HAVE_DATA) &&
(status & SPA_STATUS_NEED_DATA))
goto again;
}
spa_log_trace_fp(this->log, "%p: process status:%d", this, status);
this->master = false;
return status;

View file

@ -639,7 +639,7 @@ static int impl_port_use_buffers(void *object,
} else
size = buf_size;
}
pw_log_debug(NAME" %p: got buffer %d %d datas, mapped size %d", stream, i,
pw_log_debug(NAME" %p: got buffer id:%d datas:%d, mapped size %d", stream, i,
buffers[i]->n_datas, size);
}