mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-20 08:00:05 +01:00
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:
parent
4f39329ca9
commit
a172bf0f55
1 changed files with 3 additions and 3 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue