Commit 51b356ee authored by Paul B Mahol's avatar Paul B Mahol

avfilter/af_sofalizer: stop allocating never used buffers

parent 86555a2f
......@@ -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;
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->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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment