static int compand_nodelay(AVFilterContext *ctx, AVFrame *frame)

{

    CompandContext *s = ctx->priv;

    AVFilterLink *inlink = ctx->inputs[0];

    const int channels = inlink->channels;

    const int nb_samples = frame->nb_samples;

    AVFrame *out_frame;

    int chan, i;



    if (av_frame_is_writable(frame)) {

        out_frame = frame;

    } else {

        out_frame = ff_get_audio_buffer(inlink, nb_samples);

        if (!out_frame)

            return AVERROR(ENOMEM);

        av_frame_copy_props(out_frame, frame);

    }



    for (chan = 0; chan < channels; chan++) {

        const double *src = (double *)frame->extended_data[chan];

        double *dst = (double *)out_frame->extended_data[chan];

        ChanParam *cp = &s->channels[chan];



        for (i = 0; i < nb_samples; i++) {

            update_volume(cp, fabs(src[i]));



            dst[i] = av_clipd(src[i] * get_volume(s, cp->volume), -1, 1);

        }

    }



    if (frame != out_frame)

        av_frame_free(&frame);



    return ff_filter_frame(ctx->outputs[0], out_frame);

}

static int compand_nodelay(AVFilterContext *ctx, AVFrame *frame)

{

    CompandContext *s = ctx->priv;

    AVFilterLink *inlink = ctx->inputs[0];

    const int channels = inlink->channels;

    const int nb_samples = frame->nb_samples;

    AVFrame *out_frame;

    int chan, i;



    if (av_frame_is_writable(frame)) {

        out_frame = frame;

    } else {

        out_frame = ff_get_audio_buffer(inlink, nb_samples);

        if (!out_frame)

            return AVERROR(ENOMEM);

        av_frame_copy_props(out_frame, frame);

    }



    for (chan = 0; chan < channels; chan++) {

        const double *src = (double *)frame->extended_data[chan];

        double *dst = (double *)out_frame->extended_data[chan];

        ChanParam *cp = &s->channels[chan];



        for (i = 0; i < nb_samples; i++) {

            update_volume(cp, fabs(src[i]));



            dst[i] = av_clipd(src[i] * get_volume(s, cp->volume), -1, 1);

        }

    }



    if (frame != out_frame)

        av_frame_free(&frame);



    return ff_filter_frame(ctx->outputs[0], out_frame);

}

        if (!out_frame)
static int FUNC_0(AVFilterContext *VAR_0, AVFrame *VAR_1)

{

    CompandContext *s = VAR_0->priv;

    AVFilterLink *inlink = VAR_0->inputs[0];

    const int VAR_2 = inlink->VAR_2;

    const int VAR_3 = VAR_1->VAR_3;

    AVFrame *out_frame;

    int VAR_4, VAR_5;



    if (av_frame_is_writable(VAR_1)) {

        out_frame = VAR_1;

    } else {

        out_frame = ff_get_audio_buffer(inlink, VAR_3);

        if (!out_frame)

            return AVERROR(ENOMEM);

        av_frame_copy_props(out_frame, VAR_1);

    }



    for (VAR_4 = 0; VAR_4 < VAR_2; VAR_4++) {

        const double *VAR_6 = (double *)VAR_1->extended_data[VAR_4];

        double *VAR_7 = (double *)out_frame->extended_data[VAR_4];

        ChanParam *cp = &s->VAR_2[VAR_4];



        for (VAR_5 = 0; VAR_5 < VAR_3; VAR_5++) {

            update_volume(cp, fabs(VAR_6[VAR_5]));



            VAR_7[VAR_5] = av_clipd(VAR_6[VAR_5] * get_volume(s, cp->volume), -1, 1);

        }

    }



    if (VAR_1 != out_frame)

        av_frame_free(&VAR_1);



    return ff_filter_frame(VAR_0->outputs[0], out_frame);

}

static int FUNC_0(AVFilterContext *VAR_0, AVFrame *VAR_1)
{ CompandContext *s = VAR_0->priv; AVFilterLink *inlink = VAR_0->inputs[0]; const int VAR_2 = inlink->VAR_2; const int VAR_3 = VAR_1->VAR_3; AVFrame *out_frame; int VAR_4, VAR_5; if (av_frame_is_writable(VAR_1)) { out_frame = VAR_1; } else { out_frame = ff_get_audio_buffer(inlink, VAR_3); if (!out_frame)
return AVERROR(ENOMEM); av_frame_copy_props(out_frame, VAR_1); } for (VAR_4 = 0; VAR_4 < VAR_2; VAR_4++) { const double *VAR_6 = (double *)VAR_1->extended_data[VAR_4]; double *VAR_7 = (double *)out_frame->extended_data[VAR_4]; ChanParam *cp = &s->VAR_2[VAR_4]; for (VAR_5 = 0; VAR_5 < VAR_3; VAR_5++) { update_volume(cp, fabs(VAR_6[VAR_5])); VAR_7[VAR_5] = av_clipd(VAR_6[VAR_5] * get_volume(s, cp->volume), -1, 1); } } if (VAR_1 != out_frame)
av_frame_free(&VAR_1); return ff_filter_frame(VAR_0->outputs[0], out_frame); }