audiomixer: only passthrough on dynamic data

When the dynamic data flag is set on the buffer data, it means the
consumer can deal with any data pointer set on the buffer and we can
simply pass the one from upstream to downstream. If the flag is not set,
we need to copy the buffer data.

See #5009
This commit is contained in:
Wim Taymans 2025-12-01 16:32:16 +01:00
parent 4f39329ca9
commit a172bf0f55

View file

@ -790,6 +790,7 @@ static int impl_node_process(void *object)
uint32_t n_buffers, maxsize; uint32_t n_buffers, maxsize;
struct buffer **buffers; struct buffer **buffers;
struct buffer *outb; struct buffer *outb;
struct spa_data *d;
const void **datas; const void **datas;
uint32_t cycle = this->position->clock.cycle & 1; uint32_t cycle = this->position->clock.cycle & 1;
@ -856,12 +857,11 @@ static int impl_node_process(void *object)
outport->n_buffers); outport->n_buffers);
return -EPIPE; return -EPIPE;
} }
d = outb->buf.datas;
if (n_buffers == 1) { if (n_buffers == 1 && SPA_FLAG_IS_SET(d[0].flags, SPA_DATA_FLAG_DYNAMIC)) {
*outb->buffer = *buffers[0]->buffer; *outb->buffer = *buffers[0]->buffer;
} else { } else {
struct spa_data *d = outb->buf.datas;
*outb->buffer = outb->buf; *outb->buffer = outb->buf;
maxsize = SPA_MIN(maxsize, d[0].maxsize); maxsize = SPA_MIN(maxsize, d[0].maxsize);