int opt_default(const char *opt, const char *arg)

{

    const AVOption *oc, *of, *os, *oswr;

    char opt_stripped[128];

    const char *p;

    const AVClass *cc = avcodec_get_class(), *fc = avformat_get_class(), *sc, *swr_class;



    if (!(p = strchr(opt, ':')))

        p = opt + strlen(opt);

    av_strlcpy(opt_stripped, opt, FFMIN(sizeof(opt_stripped), p - opt + 1));



    if ((oc = av_opt_find(&cc, opt_stripped, NULL, 0,

                         AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)) ||

        ((opt[0] == 'v' || opt[0] == 'a' || opt[0] == 's') &&

         (oc = av_opt_find(&cc, opt + 1, NULL, 0, AV_OPT_SEARCH_FAKE_OBJ))))

        av_dict_set(&codec_opts, opt, arg, FLAGS(oc));

    if ((of = av_opt_find(&fc, opt, NULL, 0,

                          AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)))

        av_dict_set(&format_opts, opt, arg, FLAGS(of));

#if CONFIG_SWSCALE

    sc = sws_get_class();

    if ((os = av_opt_find(&sc, opt, NULL, 0,

                          AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {

        // XXX we only support sws_flags, not arbitrary sws options

        int ret = av_opt_set(sws_opts, opt, arg, 0);

        if (ret < 0) {

            av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt);

            return ret;

        }

    }

#endif

    swr_class = swr_get_class();

    if (!oc && !of && !os && (oswr = av_opt_find(&swr_class, opt, NULL, 0,

                          AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {

        int ret = av_opt_set(swr_opts, opt, arg, 0);

        if (ret < 0) {

            av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt);

            return ret;

        }

    }



    if (oc || of || os || oswr)

        return 0;

    av_log(NULL, AV_LOG_ERROR, "Unrecognized option '%s'\n", opt);

    return AVERROR_OPTION_NOT_FOUND;

}

int opt_default(const char *opt, const char *arg)

{

    const AVOption *oc, *of, *os, *oswr;

    char opt_stripped[128];

    const char *p;

    const AVClass *cc = avcodec_get_class(), *fc = avformat_get_class(), *sc, *swr_class;



    if (!(p = strchr(opt, ':')))

        p = opt + strlen(opt);

    av_strlcpy(opt_stripped, opt, FFMIN(sizeof(opt_stripped), p - opt + 1));



    if ((oc = av_opt_find(&cc, opt_stripped, NULL, 0,

                         AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)) ||

        ((opt[0] == 'v' || opt[0] == 'a' || opt[0] == 's') &&

         (oc = av_opt_find(&cc, opt + 1, NULL, 0, AV_OPT_SEARCH_FAKE_OBJ))))

        av_dict_set(&codec_opts, opt, arg, FLAGS(oc));

    if ((of = av_opt_find(&fc, opt, NULL, 0,

                          AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)))

        av_dict_set(&format_opts, opt, arg, FLAGS(of));

#if CONFIG_SWSCALE

    sc = sws_get_class();

    if ((os = av_opt_find(&sc, opt, NULL, 0,

                          AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {

        

        int ret = av_opt_set(sws_opts, opt, arg, 0);

        if (ret < 0) {

            av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt);

            return ret;

        }

    }

#endif

    swr_class = swr_get_class();

    if (!oc && !of && !os && (oswr = av_opt_find(&swr_class, opt, NULL, 0,

                          AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {

        int ret = av_opt_set(swr_opts, opt, arg, 0);

        if (ret < 0) {

            av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt);

            return ret;

        }

    }



    if (oc || of || os || oswr)

        return 0;

    av_log(NULL, AV_LOG_ERROR, "Unrecognized option '%s'\n", opt);

    return AVERROR_OPTION_NOT_FOUND;

}

    const AVOption *oc, *of, *os, *oswr;
int FUNC_0(const char *VAR_0, const char *VAR_1)

{

    const AVOption *VAR_2, *of, *os, *oswr;

    char VAR_3[128];

    const char *VAR_4;

    const AVClass *VAR_5 = avcodec_get_class(), *fc = avformat_get_class(), *sc, *swr_class;



    if (!(VAR_4 = strchr(VAR_0, ':')))

        VAR_4 = VAR_0 + strlen(VAR_0);

    av_strlcpy(VAR_3, VAR_0, FFMIN(sizeof(VAR_3), VAR_4 - VAR_0 + 1));



    if ((VAR_2 = av_opt_find(&VAR_5, VAR_3, NULL, 0,

                         AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)) ||

        ((VAR_0[0] == 'v' || VAR_0[0] == 'a' || VAR_0[0] == 's') &&

         (VAR_2 = av_opt_find(&VAR_5, VAR_0 + 1, NULL, 0, AV_OPT_SEARCH_FAKE_OBJ))))

        av_dict_set(&codec_opts, VAR_0, VAR_1, FLAGS(VAR_2));

    if ((of = av_opt_find(&fc, VAR_0, NULL, 0,

                          AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)))

        av_dict_set(&format_opts, VAR_0, VAR_1, FLAGS(of));

#if CONFIG_SWSCALE

    sc = sws_get_class();

    if ((os = av_opt_find(&sc, VAR_0, NULL, 0,

                          AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {

        

        int VAR_6 = av_opt_set(sws_opts, VAR_0, VAR_1, 0);

        if (VAR_6 < 0) {

            av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", VAR_0);

            return VAR_6;

        }

    }

#endif

    swr_class = swr_get_class();

    if (!VAR_2 && !of && !os && (oswr = av_opt_find(&swr_class, VAR_0, NULL, 0,

                          AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {

        int VAR_6 = av_opt_set(swr_opts, VAR_0, VAR_1, 0);

        if (VAR_6 < 0) {

            av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", VAR_0);

            return VAR_6;

        }

    }



    if (VAR_2 || of || os || oswr)

        return 0;

    av_log(NULL, AV_LOG_ERROR, "Unrecognized option '%s'\n", VAR_0);

    return AVERROR_OPTION_NOT_FOUND;

}

int FUNC_0(const char *VAR_0, const char *VAR_1)
{ const AVOption *VAR_2, *of, *os, *oswr; char VAR_3[128]; const char *VAR_4; const AVClass *VAR_5 = avcodec_get_class(), *fc = avformat_get_class(), *sc, *swr_class; if (!(VAR_4 = strchr(VAR_0, ':')))
VAR_4 = VAR_0 + strlen(VAR_0); av_strlcpy(VAR_3, VAR_0, FFMIN(sizeof(VAR_3), VAR_4 - VAR_0 + 1)); if ((VAR_2 = av_opt_find(&VAR_5, VAR_3, NULL, 0,
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)) ||
((VAR_0[0] == 'v' || VAR_0[0] == 'a' || VAR_0[0] == 's') &&
(VAR_2 = av_opt_find(&VAR_5, VAR_0 + 1, NULL, 0, AV_OPT_SEARCH_FAKE_OBJ))))
av_dict_set(&codec_opts, VAR_0, VAR_1, FLAGS(VAR_2)); if ((of = av_opt_find(&fc, VAR_0, NULL, 0,
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)))
av_dict_set(&format_opts, VAR_0, VAR_1, FLAGS(of)); #if CONFIG_SWSCALE
sc = sws_get_class(); if ((os = av_opt_find(&sc, VAR_0, NULL, 0,
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) { int VAR_6 = av_opt_set(sws_opts, VAR_0, VAR_1, 0); if (VAR_6 < 0) { av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", VAR_0); return VAR_6; } } #endif
swr_class = swr_get_class(); if (!VAR_2 && !of && !os && (oswr = av_opt_find(&swr_class, VAR_0, NULL, 0,
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) { int VAR_6 = av_opt_set(swr_opts, VAR_0, VAR_1, 0); if (VAR_6 < 0) { av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", VAR_0); return VAR_6; } } if (VAR_2 || of || os || oswr)
return 0; av_log(NULL, AV_LOG_ERROR, "Unrecognized option '%s'\n", VAR_0); return AVERROR_OPTION_NOT_FOUND; }