int ff_request_frame(AVFilterLink *link)

{

    int ret = -1;

    FF_TPRINTF_START(NULL, request_frame); ff_tlog_link(NULL, link, 1);



    if (link->closed)

        return AVERROR_EOF;

    av_assert0(!link->frame_requested);

    link->frame_requested = 1;

    while (link->frame_requested) {

        if (link->srcpad->request_frame)

            ret = link->srcpad->request_frame(link);

        else if (link->src->inputs[0])

            ret = ff_request_frame(link->src->inputs[0]);

        if (ret == AVERROR_EOF && link->partial_buf) {

            AVFrame *pbuf = link->partial_buf;

            link->partial_buf = NULL;

            ret = ff_filter_frame_framed(link, pbuf);

        }

        if (ret < 0) {

            link->frame_requested = 0;

            if (ret == AVERROR_EOF)

                link->closed = 1;

        } else {

            av_assert0(!link->frame_requested ||

                       link->flags & FF_LINK_FLAG_REQUEST_LOOP);

        }

    }

    return ret;

}

int ff_request_frame(AVFilterLink *link)

{

    int ret = -1;

    FF_TPRINTF_START(NULL, request_frame); ff_tlog_link(NULL, link, 1);



    if (link->closed)

        return AVERROR_EOF;

    av_assert0(!link->frame_requested);

    link->frame_requested = 1;

    while (link->frame_requested) {

        if (link->srcpad->request_frame)

            ret = link->srcpad->request_frame(link);

        else if (link->src->inputs[0])

            ret = ff_request_frame(link->src->inputs[0]);

        if (ret == AVERROR_EOF && link->partial_buf) {

            AVFrame *pbuf = link->partial_buf;

            link->partial_buf = NULL;

            ret = ff_filter_frame_framed(link, pbuf);

        }

        if (ret < 0) {

            link->frame_requested = 0;

            if (ret == AVERROR_EOF)

                link->closed = 1;

        } else {

            av_assert0(!link->frame_requested ||

                       link->flags & FF_LINK_FLAG_REQUEST_LOOP);

        }

    }

    return ret;

}

int FUNC_0(AVFilterLink *VAR_0)

{

    int VAR_1 = -1;

    FF_TPRINTF_START(NULL, request_frame); ff_tlog_link(NULL, VAR_0, 1);



    if (VAR_0->closed)

        return AVERROR_EOF;

    av_assert0(!VAR_0->frame_requested);

    VAR_0->frame_requested = 1;

    while (VAR_0->frame_requested) {

        if (VAR_0->srcpad->request_frame)

            VAR_1 = VAR_0->srcpad->request_frame(VAR_0);

        else if (VAR_0->src->inputs[0])

            VAR_1 = FUNC_0(VAR_0->src->inputs[0]);

        if (VAR_1 == AVERROR_EOF && VAR_0->partial_buf) {

            AVFrame *pbuf = VAR_0->partial_buf;

            VAR_0->partial_buf = NULL;

            VAR_1 = ff_filter_frame_framed(VAR_0, pbuf);

        }

        if (VAR_1 < 0) {

            VAR_0->frame_requested = 0;

            if (VAR_1 == AVERROR_EOF)

                VAR_0->closed = 1;

        } else {

            av_assert0(!VAR_0->frame_requested ||

                       VAR_0->flags & FF_LINK_FLAG_REQUEST_LOOP);

        }

    }

    return VAR_1;

}

int FUNC_0(AVFilterLink *VAR_0)
{ int VAR_1 = -1; FF_TPRINTF_START(NULL, request_frame); ff_tlog_link(NULL, VAR_0, 1); if (VAR_0->closed)
return AVERROR_EOF; av_assert0(!VAR_0->frame_requested); VAR_0->frame_requested = 1; while (VAR_0->frame_requested) { if (VAR_0->srcpad->request_frame)
VAR_1 = VAR_0->srcpad->request_frame(VAR_0); else if (VAR_0->src->inputs[0])
VAR_1 = FUNC_0(VAR_0->src->inputs[0]); if (VAR_1 == AVERROR_EOF && VAR_0->partial_buf) { AVFrame *pbuf = VAR_0->partial_buf; VAR_0->partial_buf = NULL; VAR_1 = ff_filter_frame_framed(VAR_0, pbuf); } if (VAR_1 < 0) { VAR_0->frame_requested = 0; if (VAR_1 == AVERROR_EOF)
VAR_0->closed = 1; } else { av_assert0(!VAR_0->frame_requested ||
VAR_0->flags & FF_LINK_FLAG_REQUEST_LOOP); } } return VAR_1; }