static int split_init(AVFilterContext *ctx, const char *args, void *opaque)

{

    int i, nb_outputs = 2;



    if (args) {

        nb_outputs = strtol(args, NULL, 0);

        if (nb_outputs <= 0) {

            av_log(ctx, AV_LOG_ERROR, "Invalid number of outputs specified: %d.\n",

                   nb_outputs);

            return AVERROR(EINVAL);

        }

    }



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

        char name[32];

        AVFilterPad pad = { 0 };



        snprintf(name, sizeof(name), "output%d", i);

        pad.type = !strcmp(ctx->name, "split") ? AVMEDIA_TYPE_VIDEO : AVMEDIA_TYPE_AUDIO;

        pad.name = av_strdup(name);



        avfilter_insert_outpad(ctx, i, &pad);

    }



    return 0;

}

static int split_init(AVFilterContext *ctx, const char *args, void *opaque)

{

    int i, nb_outputs = 2;



    if (args) {

        nb_outputs = strtol(args, NULL, 0);

        if (nb_outputs <= 0) {

            av_log(ctx, AV_LOG_ERROR, "Invalid number of outputs specified: %d.\n",

                   nb_outputs);

            return AVERROR(EINVAL);

        }

    }



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

        char name[32];

        AVFilterPad pad = { 0 };



        snprintf(name, sizeof(name), "output%d", i);

        pad.type = !strcmp(ctx->name, "split") ? AVMEDIA_TYPE_VIDEO : AVMEDIA_TYPE_AUDIO;

        pad.name = av_strdup(name);



        avfilter_insert_outpad(ctx, i, &pad);

    }



    return 0;

}

static int FUNC_0(AVFilterContext *VAR_0, const char *VAR_1, void *VAR_2)

{

    int VAR_3, VAR_4 = 2;



    if (VAR_1) {

        VAR_4 = strtol(VAR_1, NULL, 0);

        if (VAR_4 <= 0) {

            av_log(VAR_0, AV_LOG_ERROR, "Invalid number of outputs specified: %d.\n",

                   VAR_4);

            return AVERROR(EINVAL);

        }

    }



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

        char VAR_5[32];

        AVFilterPad pad = { 0 };



        snprintf(VAR_5, sizeof(VAR_5), "output%d", VAR_3);

        pad.type = !strcmp(VAR_0->VAR_5, "split") ? AVMEDIA_TYPE_VIDEO : AVMEDIA_TYPE_AUDIO;

        pad.VAR_5 = av_strdup(VAR_5);



        avfilter_insert_outpad(VAR_0, VAR_3, &pad);

    }



    return 0;

}

static int FUNC_0(AVFilterContext *VAR_0, const char *VAR_1, void *VAR_2)
{ int VAR_3, VAR_4 = 2; if (VAR_1) { VAR_4 = strtol(VAR_1, NULL, 0); if (VAR_4 <= 0) { av_log(VAR_0, AV_LOG_ERROR, "Invalid number of outputs specified: %d.\n",
VAR_4); return AVERROR(EINVAL); } } for (VAR_3 = 0; VAR_3 < VAR_4; VAR_3++) { char VAR_5[32]; AVFilterPad pad = { 0 }; snprintf(VAR_5, sizeof(VAR_5), "output%d", VAR_3); pad.type = !strcmp(VAR_0->VAR_5, "split") ? AVMEDIA_TYPE_VIDEO : AVMEDIA_TYPE_AUDIO; pad.VAR_5 = av_strdup(VAR_5); avfilter_insert_outpad(VAR_0, VAR_3, &pad); } return 0; }