From 3739b634ec3f94dd5ac673af0146259139e171c2 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 12 Jan 2022 12:33:12 +0100 Subject: [PATCH] resample: remove empty buffer We don't need the empty preallocated buffer, just zero the input buffer and use that one. --- spa/plugins/audioconvert/resample.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/spa/plugins/audioconvert/resample.c b/spa/plugins/audioconvert/resample.c index 9000ed411..d2765af21 100644 --- a/spa/plugins/audioconvert/resample.c +++ b/spa/plugins/audioconvert/resample.c @@ -127,8 +127,6 @@ struct impl { struct resample resample; double rate_scale; - - float empty[MAX_SAMPLES + MAX_ALIGN]; }; #define CHECK_PORT(this,d,id) (id == 0) @@ -884,9 +882,10 @@ static int impl_node_process(void *object) outport->offset = maxsize; if (size == 0) { - size = MAX_SAMPLES * sizeof(float); + size = sb->datas[0].maxsize; + memset(sb->datas[0].data, 0, size); for (i = 0; i < sb->n_datas; i++) - src_datas[i] = SPA_PTR_ALIGN(this->empty, MAX_ALIGN, void); + src_datas[i] = sb->datas[0].data; inport->offset = 0; flush_in = draining = true; } else {