Commit e5705341 authored by Paul B Mahol's avatar Paul B Mahol

avfilter/af_afir: move allocation stuff where it belongs

parent 7312e027
......@@ -286,6 +286,13 @@ static int convert_coeffs(AVFilterContext *ctx)
for (n = av_log2(s->minp); (1 << n) < s->nb_taps; n++);
N = FFMIN(n, av_log2(s->maxp));
s->seg.coeff = av_calloc(ctx->inputs[1]->channels, sizeof(*s->seg.coeff));
s->seg.rdft = av_calloc(ctx->inputs[0]->channels, sizeof(*s->seg.rdft));
s->seg.irdft = av_calloc(ctx->inputs[0]->channels, sizeof(*s->seg.irdft));
if (!s->seg.coeff || !s->seg.rdft || !s->seg.irdft)
return AVERROR(ENOMEM);
s->seg.fft_length = (1 << (N + 1)) + 1;
s->seg.part_size = 1 << (N - 1);
s->seg.block_size = FFALIGN(s->seg.fft_length, 32);
......@@ -570,12 +577,6 @@ static int config_output(AVFilterLink *outlink)
outlink->channel_layout = ctx->inputs[0]->channel_layout;
outlink->channels = ctx->inputs[0]->channels;
s->seg.coeff = av_calloc(ctx->inputs[1]->channels, sizeof(*s->seg.coeff));
s->seg.rdft = av_calloc(outlink->channels, sizeof(*s->seg.rdft));
s->seg.irdft = av_calloc(outlink->channels, sizeof(*s->seg.irdft));
if (!s->seg.coeff || !s->seg.rdft || !s->seg.irdft)
return AVERROR(ENOMEM);
s->nb_channels = outlink->channels;
s->nb_coef_channels = ctx->inputs[1]->channels;
s->pts = AV_NOPTS_VALUE;
......
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