audioconvert: allocate memory dynamically

Instead of working with fixed buffer size, allocate everything
dynamically. This preserves a lot of memory in the normal case.
This commit is contained in:
Wim Taymans 2026-05-11 17:23:33 +02:00
parent cd654efa6a
commit f1b1f2d97b
5 changed files with 72 additions and 28 deletions

View file

@ -1630,7 +1630,7 @@ static int parse_prop_params(struct impl *this, struct spa_pod *params)
if (changed) {
this->props.filter_graph_disabled = filter_graph_disabled;
if (this->setup)
channelmix_init(&this->mix);
channelmix_reconfigure(&this->mix);
}
return changed;
}
@ -2322,6 +2322,9 @@ static int setup_channelmix(struct impl *this, uint32_t channels, uint32_t *posi
(src_chan != dst_chan || src_mask != dst_mask))
return -EPERM;
if (this->mix.free)
channelmix_free(&this->mix);
this->mix.src_chan = src_chan;
this->mix.src_mask = src_mask;
this->mix.dst_chan = dst_chan;
@ -4319,6 +4322,8 @@ static int impl_clear(struct spa_handle *handle)
free(this->graph_descs[i]);
}
if (this->mix.free)
channelmix_free(&this->mix);
if (this->resample.free)
resample_free(&this->resample);
if (this->wav_file != NULL)