resample: remove empty buffer

We don't need the empty preallocated buffer, just zero the input buffer
and use that one.
This commit is contained in:
Wim Taymans 2022-01-12 12:33:12 +01:00
parent 8844c15d4d
commit 3739b634ec

View file

@ -127,8 +127,6 @@ struct impl {
struct resample resample; struct resample resample;
double rate_scale; double rate_scale;
float empty[MAX_SAMPLES + MAX_ALIGN];
}; };
#define CHECK_PORT(this,d,id) (id == 0) #define CHECK_PORT(this,d,id) (id == 0)
@ -884,9 +882,10 @@ static int impl_node_process(void *object)
outport->offset = maxsize; outport->offset = maxsize;
if (size == 0) { 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++) 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; inport->offset = 0;
flush_in = draining = true; flush_in = draining = true;
} else { } else {