From a6ce5e7eeb03a1b64660030ae61bc40a93a10af0 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 11 Jul 2019 11:19:09 +0200 Subject: [PATCH] merger: respect DYNAMIC_DATA flag when copy pointers --- spa/plugins/audioconvert/merger.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/spa/plugins/audioconvert/merger.c b/spa/plugins/audioconvert/merger.c index 8358cd48f..7ad855139 100644 --- a/spa/plugins/audioconvert/merger.c +++ b/spa/plugins/audioconvert/merger.c @@ -908,7 +908,13 @@ static inline int handle_monitor(struct impl *this, const void *data, int n_samp size = SPA_MIN(dd->maxsize, n_samples * outport->stride); dd->chunk->offset = 0; dd->chunk->size = size; - dd->data = (void*)data; + + spa_log_trace(this->log, "%p: io %p %08x", this, outport->io, dd->flags); + + if (SPA_FLAG_CHECK(dd->flags, SPA_DATA_FLAG_DYNAMIC)) + dd->data = (void*)data; + else + memcpy(dd->data, data, size); return res; }