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

{

    AVFilterContext *ctx = inlink->dst;

    AudioEchoContext *s = ctx->priv;

    AVFrame *out_frame;



    if (av_frame_is_writable(frame)) {

        out_frame = frame;

    } else {

        out_frame = ff_get_audio_buffer(inlink, frame->nb_samples);

        if (!out_frame)

            return AVERROR(ENOMEM);

        av_frame_copy_props(out_frame, frame);

    }



    s->echo_samples(s, s->delayptrs, frame->extended_data, out_frame->extended_data,

                    frame->nb_samples, inlink->channels);



    s->next_pts = frame->pts + av_rescale_q(frame->nb_samples, (AVRational){1, inlink->sample_rate}, inlink->time_base);



    if (frame != out_frame)

        av_frame_free(&frame);



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

}

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

{

    AVFilterContext *ctx = inlink->dst;

    AudioEchoContext *s = ctx->priv;

    AVFrame *out_frame;



    if (av_frame_is_writable(frame)) {

        out_frame = frame;

    } else {

        out_frame = ff_get_audio_buffer(inlink, frame->nb_samples);

        if (!out_frame)

            return AVERROR(ENOMEM);

        av_frame_copy_props(out_frame, frame);

    }



    s->echo_samples(s, s->delayptrs, frame->extended_data, out_frame->extended_data,

                    frame->nb_samples, inlink->channels);



    s->next_pts = frame->pts + av_rescale_q(frame->nb_samples, (AVRational){1, inlink->sample_rate}, inlink->time_base);



    if (frame != out_frame)

        av_frame_free(&frame);



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

}

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

{

    AVFilterContext *ctx = VAR_0->dst;

    AudioEchoContext *s = ctx->priv;

    AVFrame *out_frame;



    if (av_frame_is_writable(VAR_1)) {

        out_frame = VAR_1;

    } else {

        out_frame = ff_get_audio_buffer(VAR_0, VAR_1->nb_samples);

        if (!out_frame)

            return AVERROR(ENOMEM);

        av_frame_copy_props(out_frame, VAR_1);

    }



    s->echo_samples(s, s->delayptrs, VAR_1->extended_data, out_frame->extended_data,

                    VAR_1->nb_samples, VAR_0->channels);



    s->next_pts = VAR_1->pts + av_rescale_q(VAR_1->nb_samples, (AVRational){1, VAR_0->sample_rate}, VAR_0->time_base);



    if (VAR_1 != out_frame)

        av_frame_free(&VAR_1);



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

}

static int FUNC_0(AVFilterLink *VAR_0, AVFrame *VAR_1)
{ AVFilterContext *ctx = VAR_0->dst; AudioEchoContext *s = ctx->priv; AVFrame *out_frame; if (av_frame_is_writable(VAR_1)) { out_frame = VAR_1; } else { out_frame = ff_get_audio_buffer(VAR_0, VAR_1->nb_samples); if (!out_frame)
return AVERROR(ENOMEM); av_frame_copy_props(out_frame, VAR_1); } s->echo_samples(s, s->delayptrs, VAR_1->extended_data, out_frame->extended_data,
VAR_1->nb_samples, VAR_0->channels); s->next_pts = VAR_1->pts + av_rescale_q(VAR_1->nb_samples, (AVRational){1, VAR_0->sample_rate}, VAR_0->time_base); if (VAR_1 != out_frame)
av_frame_free(&VAR_1); return ff_filter_frame(ctx->outputs[0], out_frame); }