static int push_samples(AVFilterContext *ctx, int nb_samples)

{

    AVFilterLink *outlink = ctx->outputs[0];

    LoopContext *s = ctx->priv;

    AVFrame *out;

    int ret, i = 0;



    while (s->loop != 0 && i < nb_samples) {

        out = ff_get_audio_buffer(outlink, FFMIN(nb_samples, s->nb_samples - s->current_sample));

        if (!out)

            return AVERROR(ENOMEM);

        ret = av_audio_fifo_peek_at(s->fifo, (void **)out->extended_data, out->nb_samples, s->current_sample);

        if (ret < 0)

            return ret;

        out->pts = s->pts;

        out->nb_samples = ret;

        s->pts += out->nb_samples;

        i += out->nb_samples;

        s->current_sample += out->nb_samples;



        ret = ff_filter_frame(outlink, out);

        if (ret < 0)

            return ret;



        if (s->current_sample >= s->nb_samples) {

            s->current_sample = 0;



            if (s->loop > 0)

                s->loop--;

        }

    }



    return ret;

}

static int push_samples(AVFilterContext *ctx, int nb_samples)

{

    AVFilterLink *outlink = ctx->outputs[0];

    LoopContext *s = ctx->priv;

    AVFrame *out;

    int ret, i = 0;



    while (s->loop != 0 && i < nb_samples) {

        out = ff_get_audio_buffer(outlink, FFMIN(nb_samples, s->nb_samples - s->current_sample));

        if (!out)

            return AVERROR(ENOMEM);

        ret = av_audio_fifo_peek_at(s->fifo, (void **)out->extended_data, out->nb_samples, s->current_sample);

        if (ret < 0)

            return ret;

        out->pts = s->pts;

        out->nb_samples = ret;

        s->pts += out->nb_samples;

        i += out->nb_samples;

        s->current_sample += out->nb_samples;



        ret = ff_filter_frame(outlink, out);

        if (ret < 0)

            return ret;



        if (s->current_sample >= s->nb_samples) {

            s->current_sample = 0;



            if (s->loop > 0)

                s->loop--;

        }

    }



    return ret;

}

        if (ret < 0)
static int FUNC_0(AVFilterContext *VAR_0, int VAR_1)

{

    AVFilterLink *outlink = VAR_0->outputs[0];

    LoopContext *s = VAR_0->priv;

    AVFrame *out;

    int VAR_2, VAR_3 = 0;



    while (s->loop != 0 && VAR_3 < VAR_1) {

        out = ff_get_audio_buffer(outlink, FFMIN(VAR_1, s->VAR_1 - s->current_sample));

        if (!out)

            return AVERROR(ENOMEM);

        VAR_2 = av_audio_fifo_peek_at(s->fifo, (void **)out->extended_data, out->VAR_1, s->current_sample);

        if (VAR_2 < 0)

            return VAR_2;

        out->pts = s->pts;

        out->VAR_1 = VAR_2;

        s->pts += out->VAR_1;

        VAR_3 += out->VAR_1;

        s->current_sample += out->VAR_1;



        VAR_2 = ff_filter_frame(outlink, out);

        if (VAR_2 < 0)

            return VAR_2;



        if (s->current_sample >= s->VAR_1) {

            s->current_sample = 0;



            if (s->loop > 0)

                s->loop--;

        }

    }



    return VAR_2;

}

static int FUNC_0(AVFilterContext *VAR_0, int VAR_1)
{ AVFilterLink *outlink = VAR_0->outputs[0]; LoopContext *s = VAR_0->priv; AVFrame *out; int VAR_2, VAR_3 = 0; while (s->loop != 0 && VAR_3 < VAR_1) { out = ff_get_audio_buffer(outlink, FFMIN(VAR_1, s->VAR_1 - s->current_sample)); if (!out)
return AVERROR(ENOMEM); VAR_2 = av_audio_fifo_peek_at(s->fifo, (void **)out->extended_data, out->VAR_1, s->current_sample); if (VAR_2 < 0)
return VAR_2; out->pts = s->pts; out->VAR_1 = VAR_2; s->pts += out->VAR_1; VAR_3 += out->VAR_1; s->current_sample += out->VAR_1; VAR_2 = ff_filter_frame(outlink, out); if (VAR_2 < 0)
return VAR_2; if (s->current_sample >= s->VAR_1) { s->current_sample = 0; if (s->loop > 0)
s->loop--; } } return VAR_2; }