static void resample_open(struct filter_node *fn)
{
- struct resample_context *ctx = para_calloc(sizeof(*ctx));
+ struct resample_context *ctx = zalloc(sizeof(*ctx));
struct btr_node *btrn = fn->btrn;
struct wav_params wp;
data.output_frames = num_frames * ctx->ratio + 1;
out_samples = data.output_frames * ctx->channels;
- in_float = para_malloc(num_samples * sizeof(float));
+ in_float = arr_alloc(num_samples, sizeof(float));
src_short_to_float_array(in, in_float, num_samples);
data.data_in = in_float;
- data.data_out = para_malloc(out_samples * sizeof(float));
+ data.data_out = arr_alloc(out_samples, sizeof(float));
ret = src_process(ctx->src_state, &data);
free(in_float);
if (ret != 0) {
return -E_LIBSAMPLERATE;
}
out_samples = data.output_frames_gen * ctx->channels;
- out = para_malloc(out_samples * sizeof(short));
+ out = arr_alloc(out_samples, sizeof(short));
src_float_to_short_array(data.data_out, out, out_samples);
free(data.data_out);
*result = out;