static int read_ir(AVFilterLink *inlink, AVFrame *frame)

{

    AVFilterContext *ctx = inlink->dst;

    HeadphoneContext *s = ctx->priv;

    int ir_len, max_ir_len, input_number;



    for (input_number = 0; input_number < s->nb_inputs; input_number++)

        if (inlink == ctx->inputs[input_number])

            break;



    av_audio_fifo_write(s->in[input_number].fifo, (void **)frame->extended_data,

                        frame->nb_samples);

    av_frame_free(&frame);



    ir_len = av_audio_fifo_size(s->in[input_number].fifo);

    max_ir_len = 65536;

    if (ir_len > max_ir_len) {

        av_log(ctx, AV_LOG_ERROR, "Too big length of IRs: %d > %d.\n", ir_len, max_ir_len);

        return AVERROR(EINVAL);

    }

    s->in[input_number].ir_len = ir_len;

    s->ir_len = FFMAX(ir_len, s->ir_len);



    return 0;

}

static int read_ir(AVFilterLink *inlink, AVFrame *frame)

{

    AVFilterContext *ctx = inlink->dst;

    HeadphoneContext *s = ctx->priv;

    int ir_len, max_ir_len, input_number;



    for (input_number = 0; input_number < s->nb_inputs; input_number++)

        if (inlink == ctx->inputs[input_number])

            break;



    av_audio_fifo_write(s->in[input_number].fifo, (void **)frame->extended_data,

                        frame->nb_samples);

    av_frame_free(&frame);



    ir_len = av_audio_fifo_size(s->in[input_number].fifo);

    max_ir_len = 65536;

    if (ir_len > max_ir_len) {

        av_log(ctx, AV_LOG_ERROR, "Too big length of IRs: %d > %d.\n", ir_len, max_ir_len);

        return AVERROR(EINVAL);

    }

    s->in[input_number].ir_len = ir_len;

    s->ir_len = FFMAX(ir_len, s->ir_len);



    return 0;

}

static int FUNC_0(AVFilterLink *VAR_0, AVFrame *VAR_1)

{

    AVFilterContext *ctx = VAR_0->dst;

    HeadphoneContext *s = ctx->priv;

    int VAR_2, VAR_3, VAR_4;



    for (VAR_4 = 0; VAR_4 < s->nb_inputs; VAR_4++)

        if (VAR_0 == ctx->inputs[VAR_4])

            break;



    av_audio_fifo_write(s->in[VAR_4].fifo, (void **)VAR_1->extended_data,

                        VAR_1->nb_samples);

    av_frame_free(&VAR_1);



    VAR_2 = av_audio_fifo_size(s->in[VAR_4].fifo);

    VAR_3 = 65536;

    if (VAR_2 > VAR_3) {

        av_log(ctx, AV_LOG_ERROR, "Too big length of IRs: %d > %d.\n", VAR_2, VAR_3);

        return AVERROR(EINVAL);

    }

    s->in[VAR_4].VAR_2 = VAR_2;

    s->VAR_2 = FFMAX(VAR_2, s->VAR_2);



    return 0;

}

static int FUNC_0(AVFilterLink *VAR_0, AVFrame *VAR_1)
{ AVFilterContext *ctx = VAR_0->dst; HeadphoneContext *s = ctx->priv; int VAR_2, VAR_3, VAR_4; for (VAR_4 = 0; VAR_4 < s->nb_inputs; VAR_4++) if (VAR_0 == ctx->inputs[VAR_4])
break; av_audio_fifo_write(s->in[VAR_4].fifo, (void **)VAR_1->extended_data,
VAR_1->nb_samples); av_frame_free(&VAR_1); VAR_2 = av_audio_fifo_size(s->in[VAR_4].fifo); VAR_3 = 65536; if (VAR_2 > VAR_3) { av_log(ctx, AV_LOG_ERROR, "Too big length of IRs: %d > %d.\n", VAR_2, VAR_3); return AVERROR(EINVAL); } s->in[VAR_4].VAR_2 = VAR_2; s->VAR_2 = FFMAX(VAR_2, s->VAR_2); return 0; }