From a172bf0f5576e8984cc62a402582b0bfd83588aa Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 1 Dec 2025 16:32:16 +0100 Subject: [PATCH] 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 --- spa/plugins/audiomixer/audiomixer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spa/plugins/audiomixer/audiomixer.c b/spa/plugins/audiomixer/audiomixer.c index f7558ef47..99b0658a0 100644 --- a/spa/plugins/audiomixer/audiomixer.c +++ b/spa/plugins/audiomixer/audiomixer.c @@ -790,6 +790,7 @@ static int impl_node_process(void *object) uint32_t n_buffers, maxsize; struct buffer **buffers; struct buffer *outb; + struct spa_data *d; const void **datas; uint32_t cycle = this->position->clock.cycle & 1; @@ -856,12 +857,11 @@ static int impl_node_process(void *object) outport->n_buffers); 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; } else { - struct spa_data *d = outb->buf.datas; - *outb->buffer = outb->buf; maxsize = SPA_MIN(maxsize, d[0].maxsize);