static int create_filter(AVFilterContext **filt_ctx, AVFilterGraph *ctx, int index,

                         const char *filt_name, const char *args, void *log_ctx)

{

    AVFilter *filt;

    char inst_name[30];

    char tmp_args[256];

    int ret;



    snprintf(inst_name, sizeof(inst_name), "Parsed_%s_%d", filt_name, index);



    filt = avfilter_get_by_name(filt_name);



    if (!filt) {

        av_log(log_ctx, AV_LOG_ERROR,

               "No such filter: '%s'\n", filt_name);

        return AVERROR(EINVAL);

    }



    *filt_ctx = avfilter_graph_alloc_filter(ctx, filt, inst_name);

    if (!*filt_ctx) {

        av_log(log_ctx, AV_LOG_ERROR,

               "Error creating filter '%s'\n", filt_name);

        return AVERROR(ENOMEM);

    }



    if (!strcmp(filt_name, "scale") && args && !strstr(args, "flags") &&

        ctx->scale_sws_opts) {

        snprintf(tmp_args, sizeof(tmp_args), "%s:%s",

                 args, ctx->scale_sws_opts);

        args = tmp_args;

    }



    ret = avfilter_init_str(*filt_ctx, args);

    if (ret < 0) {

        av_log(log_ctx, AV_LOG_ERROR,

               "Error initializing filter '%s'", filt_name);

        if (args)

            av_log(log_ctx, AV_LOG_ERROR, " with args '%s'", args);

        av_log(log_ctx, AV_LOG_ERROR, "\n");

        return ret;

    }



    return 0;

}

static int create_filter(AVFilterContext **filt_ctx, AVFilterGraph *ctx, int index,

                         const char *filt_name, const char *args, void *log_ctx)

{

    AVFilter *filt;

    char inst_name[30];

    char tmp_args[256];

    int ret;



    snprintf(inst_name, sizeof(inst_name), "Parsed_%s_%d", filt_name, index);



    filt = avfilter_get_by_name(filt_name);



    if (!filt) {

        av_log(log_ctx, AV_LOG_ERROR,

               "No such filter: '%s'\n", filt_name);

        return AVERROR(EINVAL);

    }



    *filt_ctx = avfilter_graph_alloc_filter(ctx, filt, inst_name);

    if (!*filt_ctx) {

        av_log(log_ctx, AV_LOG_ERROR,

               "Error creating filter '%s'\n", filt_name);

        return AVERROR(ENOMEM);

    }



    if (!strcmp(filt_name, "scale") && args && !strstr(args, "flags") &&

        ctx->scale_sws_opts) {

        snprintf(tmp_args, sizeof(tmp_args), "%s:%s",

                 args, ctx->scale_sws_opts);

        args = tmp_args;

    }



    ret = avfilter_init_str(*filt_ctx, args);

    if (ret < 0) {

        av_log(log_ctx, AV_LOG_ERROR,

               "Error initializing filter '%s'", filt_name);

        if (args)

            av_log(log_ctx, AV_LOG_ERROR, " with args '%s'", args);

        av_log(log_ctx, AV_LOG_ERROR, "\n");

        return ret;

    }



    return 0;

}

static int FUNC_0(AVFilterContext **VAR_0, AVFilterGraph *VAR_1, int VAR_2,

                         const char *VAR_3, const char *VAR_4, void *VAR_5)

{

    AVFilter *filt;

    char VAR_6[30];

    char VAR_7[256];

    int VAR_8;



    snprintf(VAR_6, sizeof(VAR_6), "Parsed_%s_%d", VAR_3, VAR_2);



    filt = avfilter_get_by_name(VAR_3);



    if (!filt) {

        av_log(VAR_5, AV_LOG_ERROR,

               "No such filter: '%s'\n", VAR_3);

        return AVERROR(EINVAL);

    }



    *VAR_0 = avfilter_graph_alloc_filter(VAR_1, filt, VAR_6);

    if (!*VAR_0) {

        av_log(VAR_5, AV_LOG_ERROR,

               "Error creating filter '%s'\n", VAR_3);

        return AVERROR(ENOMEM);

    }



    if (!strcmp(VAR_3, "scale") && VAR_4 && !strstr(VAR_4, "flags") &&

        VAR_1->scale_sws_opts) {

        snprintf(VAR_7, sizeof(VAR_7), "%s:%s",

                 VAR_4, VAR_1->scale_sws_opts);

        VAR_4 = VAR_7;

    }



    VAR_8 = avfilter_init_str(*VAR_0, VAR_4);

    if (VAR_8 < 0) {

        av_log(VAR_5, AV_LOG_ERROR,

               "Error initializing filter '%s'", VAR_3);

        if (VAR_4)

            av_log(VAR_5, AV_LOG_ERROR, " with VAR_4 '%s'", VAR_4);

        av_log(VAR_5, AV_LOG_ERROR, "\n");

        return VAR_8;

    }



    return 0;

}

static int FUNC_0(AVFilterContext **VAR_0, AVFilterGraph *VAR_1, int VAR_2,
const char *VAR_3, const char *VAR_4, void *VAR_5)
{ AVFilter *filt; char VAR_6[30]; char VAR_7[256]; int VAR_8; snprintf(VAR_6, sizeof(VAR_6), "Parsed_%s_%d", VAR_3, VAR_2); filt = avfilter_get_by_name(VAR_3); if (!filt) { av_log(VAR_5, AV_LOG_ERROR,
"No such filter: '%s'\n", VAR_3); return AVERROR(EINVAL); } *VAR_0 = avfilter_graph_alloc_filter(VAR_1, filt, VAR_6); if (!*VAR_0) { av_log(VAR_5, AV_LOG_ERROR,
"Error creating filter '%s'\n", VAR_3); return AVERROR(ENOMEM); } if (!strcmp(VAR_3, "scale") && VAR_4 && !strstr(VAR_4, "flags") &&
VAR_1->scale_sws_opts) { snprintf(VAR_7, sizeof(VAR_7), "%s:%s",
VAR_4, VAR_1->scale_sws_opts); VAR_4 = VAR_7; } VAR_8 = avfilter_init_str(*VAR_0, VAR_4); if (VAR_8 < 0) { av_log(VAR_5, AV_LOG_ERROR,
"Error initializing filter '%s'", VAR_3); if (VAR_4)
av_log(VAR_5, AV_LOG_ERROR, " with VAR_4 '%s'", VAR_4); av_log(VAR_5, AV_LOG_ERROR, "\n"); return VAR_8; } return 0; }