mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
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:
parent
8844c15d4d
commit
3739b634ec
1 changed files with 3 additions and 4 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue