avfilter/af_sofalizer: stop allocating never used buffers

pull/304/head^2
Paul B Mahol 6 years ago
parent 86555a2fbf
commit 51b356eef8
  1. 10
      libavfilter/af_sofalizer.c

@ -719,12 +719,20 @@ static int load_data(AVFilterContext *ctx, int azim, int elev, float radius, int
n_samples = s->sofa.n_samples;
ir_samples = s->sofa.ir_samples;
if (s->type == TIME_DOMAIN) {
s->data_ir[0] = av_calloc(n_samples, sizeof(float) * s->n_conv);
s->data_ir[1] = av_calloc(n_samples, sizeof(float) * s->n_conv);
if (!s->data_ir[0] || !s->data_ir[1]) {
ret = AVERROR(ENOMEM);
goto fail;
}
}
s->delay[0] = av_calloc(s->n_conv, sizeof(int));
s->delay[1] = av_calloc(s->n_conv, sizeof(int));
if (!s->data_ir[0] || !s->data_ir[1] || !s->delay[0] || !s->delay[1]) {
if (!s->delay[0] || !s->delay[1]) {
ret = AVERROR(ENOMEM);
goto fail;
}

Loading…
Cancel
Save