audioconvert: add support for buffer data mmap

When there is no data and the buffer is mmapable, try to mmap it. Unmap
again when clearing the buffers.

Use the mmaped data pointer of the buffer when processing.
This commit is contained in:
Wim Taymans 2025-03-27 15:37:19 +01:00
parent 9ceb4310f8
commit 328718f958
2 changed files with 43 additions and 15 deletions

View file

@ -1335,7 +1335,6 @@ static int clear_buffers(struct impl *this, struct port *port)
spa_log_debug(this->log, "%p: clear buffers %p %d", this, port, port->n_buffers);
for (i = 0; i < port->n_buffers; i++) {
struct buffer *b = &port->buffers[i];
spa_log_debug(this->log, "%p: %d %p %d", this, i, b, b->flags);
if (SPA_FLAG_IS_SET(b->flags, BUFFER_FLAG_MAPPED)) {
for (j = 0; j < b->buf->n_datas; j++) {
if (b->datas[j]) {