int avfilter_link(AVFilterContext *src, unsigned srcpad,

                  AVFilterContext *dst, unsigned dstpad)

{

    AVFilterLink *link;



    if (src->nb_outputs <= srcpad || dst->nb_inputs <= dstpad ||

        src->outputs[srcpad]      || dst->inputs[dstpad])

        return -1;



    if (src->output_pads[srcpad].type != dst->input_pads[dstpad].type) {

        av_log(src, AV_LOG_ERROR,

               "Media type mismatch between the '%s' filter output pad %d and the '%s' filter input pad %d\n",

               src->name, srcpad, dst->name, dstpad);

        return AVERROR(EINVAL);

    }



    src->outputs[srcpad] =

    dst-> inputs[dstpad] = link = av_mallocz(sizeof(AVFilterLink));



    link->src     = src;

    link->dst     = dst;

    link->srcpad  = &src->output_pads[srcpad];

    link->dstpad  = &dst->input_pads[dstpad];

    link->type    = src->output_pads[srcpad].type;

    assert(AV_PIX_FMT_NONE == -1 && AV_SAMPLE_FMT_NONE == -1);

    link->format  = -1;



    return 0;

}

int avfilter_link(AVFilterContext *src, unsigned srcpad,

                  AVFilterContext *dst, unsigned dstpad)

{

    AVFilterLink *link;



    if (src->nb_outputs <= srcpad || dst->nb_inputs <= dstpad ||

        src->outputs[srcpad]      || dst->inputs[dstpad])

        return -1;



    if (src->output_pads[srcpad].type != dst->input_pads[dstpad].type) {

        av_log(src, AV_LOG_ERROR,

               "Media type mismatch between the '%s' filter output pad %d and the '%s' filter input pad %d\n",

               src->name, srcpad, dst->name, dstpad);

        return AVERROR(EINVAL);

    }



    src->outputs[srcpad] =

    dst-> inputs[dstpad] = link = av_mallocz(sizeof(AVFilterLink));



    link->src     = src;

    link->dst     = dst;

    link->srcpad  = &src->output_pads[srcpad];

    link->dstpad  = &dst->input_pads[dstpad];

    link->type    = src->output_pads[srcpad].type;

    assert(AV_PIX_FMT_NONE == -1 && AV_SAMPLE_FMT_NONE == -1);

    link->format  = -1;



    return 0;

}

int FUNC_0(AVFilterContext *VAR_0, unsigned VAR_1,

                  AVFilterContext *VAR_2, unsigned VAR_3)

{

    AVFilterLink *link;



    if (VAR_0->nb_outputs <= VAR_1 || VAR_2->nb_inputs <= VAR_3 ||

        VAR_0->outputs[VAR_1]      || VAR_2->inputs[VAR_3])

        return -1;



    if (VAR_0->output_pads[VAR_1].type != VAR_2->input_pads[VAR_3].type) {

        av_log(VAR_0, AV_LOG_ERROR,

               "Media type mismatch between the '%s' filter output pad %d and the '%s' filter input pad %d\n",

               VAR_0->name, VAR_1, VAR_2->name, VAR_3);

        return AVERROR(EINVAL);

    }



    VAR_0->outputs[VAR_1] =

    VAR_2-> inputs[VAR_3] = link = av_mallocz(sizeof(AVFilterLink));



    link->VAR_0     = VAR_0;

    link->VAR_2     = VAR_2;

    link->VAR_1  = &VAR_0->output_pads[VAR_1];

    link->VAR_3  = &VAR_2->input_pads[VAR_3];

    link->type    = VAR_0->output_pads[VAR_1].type;

    assert(AV_PIX_FMT_NONE == -1 && AV_SAMPLE_FMT_NONE == -1);

    link->format  = -1;



    return 0;

}

int FUNC_0(AVFilterContext *VAR_0, unsigned VAR_1,
AVFilterContext *VAR_2, unsigned VAR_3)
{ AVFilterLink *link; if (VAR_0->nb_outputs <= VAR_1 || VAR_2->nb_inputs <= VAR_3 ||
VAR_0->outputs[VAR_1]      || VAR_2->inputs[VAR_3])
return -1; if (VAR_0->output_pads[VAR_1].type != VAR_2->input_pads[VAR_3].type) { av_log(VAR_0, AV_LOG_ERROR,
"Media type mismatch between the '%s' filter output pad %d and the '%s' filter input pad %d\n",
VAR_0->name, VAR_1, VAR_2->name, VAR_3); return AVERROR(EINVAL); } VAR_0->outputs[VAR_1] =
VAR_2-> inputs[VAR_3] = link = av_mallocz(sizeof(AVFilterLink)); link->VAR_0     = VAR_0; link->VAR_2     = VAR_2; link->VAR_1  = &VAR_0->output_pads[VAR_1]; link->VAR_3  = &VAR_2->input_pads[VAR_3]; link->type    = VAR_0->output_pads[VAR_1].type; assert(AV_PIX_FMT_NONE == -1 && AV_SAMPLE_FMT_NONE == -1); link->format  = -1; return 0; }