static int set_string_number(void *obj, void *target_obj, const AVOption *o, const char *val, void *dst)

{

    int ret = 0;

    int num, den;

    char c;



    if (sscanf(val, "%d%*1[:/]%d%c", &num, &den, &c) == 2) {

        if ((ret = write_number(obj, o, dst, 1, den, num)) >= 0)

            return ret;

        ret = 0;

    }



    for (;;) {

        int i = 0;

        char buf[256];

        int cmd = 0;

        double d;

        int64_t intnum = 1;



        if (o->type == AV_OPT_TYPE_FLAGS) {

            if (*val == '+' || *val == '-')

                cmd = *(val++);

            for (; i < sizeof(buf) - 1 && val[i] && val[i] != '+' && val[i] != '-'; i++)

                buf[i] = val[i];

            buf[i] = 0;

        }



        {

            const AVOption *o_named = av_opt_find(target_obj, buf, o->unit, 0, 0);

            int res;

            int ci = 0;

            double const_values[64];

            const char * const_names[64];

            if (o_named && o_named->type == AV_OPT_TYPE_CONST)

                d = DEFAULT_NUMVAL(o_named);

            else {

                if (o->unit) {

                    for (o_named = NULL; o_named = av_opt_next(target_obj, o_named); ) {

                        if (o_named->type == AV_OPT_TYPE_CONST &&

                            o_named->unit &&

                            !strcmp(o_named->unit, o->unit)) {

                            if (ci + 6 >= FF_ARRAY_ELEMS(const_values)) {

                                av_log(obj, AV_LOG_ERROR, "const_values array too small for %s\n", o->unit);

                                return AVERROR_PATCHWELCOME;

                            }

                            const_names [ci  ] = o_named->name;

                            const_values[ci++] = DEFAULT_NUMVAL(o_named);

                        }

                    }

                }

                const_names [ci  ] = "default";

                const_values[ci++] = DEFAULT_NUMVAL(o);

                const_names [ci  ] = "max";

                const_values[ci++] = o->max;

                const_names [ci  ] = "min";

                const_values[ci++] = o->min;

                const_names [ci  ] = "none";

                const_values[ci++] = 0;

                const_names [ci  ] = "all";

                const_values[ci++] = ~0;

                const_names [ci] = NULL;

                const_values[ci] = 0;



                res = av_expr_parse_and_eval(&d, i ? buf : val, const_names,

                                            const_values, NULL, NULL, NULL, NULL, NULL, 0, obj);

                if (res < 0) {

                    av_log(obj, AV_LOG_ERROR, "Unable to parse option value \"%s\"\n", val);

                    return res;

                }

            }

        }

        if (o->type == AV_OPT_TYPE_FLAGS) {

            read_number(o, dst, NULL, NULL, &intnum);

            if      (cmd == '+') d = intnum | (int64_t)d;

            else if (cmd == '-') d = intnum &~(int64_t)d;

        }



        if ((ret = write_number(obj, o, dst, d, 1, 1)) < 0)

            return ret;

        val += i;

        if (!i || !*val)

            return 0;

    }



    return 0;

}

static int set_string_number(void *obj, void *target_obj, const AVOption *o, const char *val, void *dst)

{

    int ret = 0;

    int num, den;

    char c;



    if (sscanf(val, "%d%*1[:/]%d%c", &num, &den, &c) == 2) {

        if ((ret = write_number(obj, o, dst, 1, den, num)) >= 0)

            return ret;

        ret = 0;

    }



    for (;;) {

        int i = 0;

        char buf[256];

        int cmd = 0;

        double d;

        int64_t intnum = 1;



        if (o->type == AV_OPT_TYPE_FLAGS) {

            if (*val == '+' || *val == '-')

                cmd = *(val++);

            for (; i < sizeof(buf) - 1 && val[i] && val[i] != '+' && val[i] != '-'; i++)

                buf[i] = val[i];

            buf[i] = 0;

        }



        {

            const AVOption *o_named = av_opt_find(target_obj, buf, o->unit, 0, 0);

            int res;

            int ci = 0;

            double const_values[64];

            const char * const_names[64];

            if (o_named && o_named->type == AV_OPT_TYPE_CONST)

                d = DEFAULT_NUMVAL(o_named);

            else {

                if (o->unit) {

                    for (o_named = NULL; o_named = av_opt_next(target_obj, o_named); ) {

                        if (o_named->type == AV_OPT_TYPE_CONST &&

                            o_named->unit &&

                            !strcmp(o_named->unit, o->unit)) {

                            if (ci + 6 >= FF_ARRAY_ELEMS(const_values)) {

                                av_log(obj, AV_LOG_ERROR, "const_values array too small for %s\n", o->unit);

                                return AVERROR_PATCHWELCOME;

                            }

                            const_names [ci  ] = o_named->name;

                            const_values[ci++] = DEFAULT_NUMVAL(o_named);

                        }

                    }

                }

                const_names [ci  ] = "default";

                const_values[ci++] = DEFAULT_NUMVAL(o);

                const_names [ci  ] = "max";

                const_values[ci++] = o->max;

                const_names [ci  ] = "min";

                const_values[ci++] = o->min;

                const_names [ci  ] = "none";

                const_values[ci++] = 0;

                const_names [ci  ] = "all";

                const_values[ci++] = ~0;

                const_names [ci] = NULL;

                const_values[ci] = 0;



                res = av_expr_parse_and_eval(&d, i ? buf : val, const_names,

                                            const_values, NULL, NULL, NULL, NULL, NULL, 0, obj);

                if (res < 0) {

                    av_log(obj, AV_LOG_ERROR, "Unable to parse option value \"%s\"\n", val);

                    return res;

                }

            }

        }

        if (o->type == AV_OPT_TYPE_FLAGS) {

            read_number(o, dst, NULL, NULL, &intnum);

            if      (cmd == '+') d = intnum | (int64_t)d;

            else if (cmd == '-') d = intnum &~(int64_t)d;

        }



        if ((ret = write_number(obj, o, dst, d, 1, 1)) < 0)

            return ret;

        val += i;

        if (!i || !*val)

            return 0;

    }



    return 0;

}

            const AVOption *o_named = av_opt_find(target_obj, buf, o->unit, 0, 0);
static int FUNC_0(void *VAR_0, void *VAR_1, const AVOption *VAR_2, const char *VAR_3, void *VAR_4)

{

    int VAR_5 = 0;

    int VAR_6, VAR_7;

    char VAR_8;



    if (sscanf(VAR_3, "%VAR_12%*1[:/]%VAR_12%VAR_8", &VAR_6, &VAR_7, &VAR_8) == 2) {

        if ((VAR_5 = write_number(VAR_0, VAR_2, VAR_4, 1, VAR_7, VAR_6)) >= 0)

            return VAR_5;

        VAR_5 = 0;

    }



    for (;;) {

        int VAR_9 = 0;

        char VAR_10[256];

        int VAR_11 = 0;

        double VAR_12;

        int64_t intnum = 1;



        if (VAR_2->type == AV_OPT_TYPE_FLAGS) {

            if (*VAR_3 == '+' || *VAR_3 == '-')

                VAR_11 = *(VAR_3++);

            for (; VAR_9 < sizeof(VAR_10) - 1 && VAR_3[VAR_9] && VAR_3[VAR_9] != '+' && VAR_3[VAR_9] != '-'; VAR_9++)

                VAR_10[VAR_9] = VAR_3[VAR_9];

            VAR_10[VAR_9] = 0;

        }



        {

            const AVOption *VAR_13 = av_opt_find(VAR_1, VAR_10, VAR_2->unit, 0, 0);

            int VAR_14;

            int VAR_15 = 0;

            double VAR_16[64];

            const char * VAR_17[64];

            if (VAR_13 && VAR_13->type == AV_OPT_TYPE_CONST)

                VAR_12 = DEFAULT_NUMVAL(VAR_13);

            else {

                if (VAR_2->unit) {

                    for (VAR_13 = NULL; VAR_13 = av_opt_next(VAR_1, VAR_13); ) {

                        if (VAR_13->type == AV_OPT_TYPE_CONST &&

                            VAR_13->unit &&

                            !strcmp(VAR_13->unit, VAR_2->unit)) {

                            if (VAR_15 + 6 >= FF_ARRAY_ELEMS(VAR_16)) {

                                av_log(VAR_0, AV_LOG_ERROR, "VAR_16 array too small for %s\n", VAR_2->unit);

                                return AVERROR_PATCHWELCOME;

                            }

                            VAR_17 [VAR_15  ] = VAR_13->name;

                            VAR_16[VAR_15++] = DEFAULT_NUMVAL(VAR_13);

                        }

                    }

                }

                VAR_17 [VAR_15  ] = "default";

                VAR_16[VAR_15++] = DEFAULT_NUMVAL(VAR_2);

                VAR_17 [VAR_15  ] = "max";

                VAR_16[VAR_15++] = VAR_2->max;

                VAR_17 [VAR_15  ] = "min";

                VAR_16[VAR_15++] = VAR_2->min;

                VAR_17 [VAR_15  ] = "none";

                VAR_16[VAR_15++] = 0;

                VAR_17 [VAR_15  ] = "all";

                VAR_16[VAR_15++] = ~0;

                VAR_17 [VAR_15] = NULL;

                VAR_16[VAR_15] = 0;



                VAR_14 = av_expr_parse_and_eval(&VAR_12, VAR_9 ? VAR_10 : VAR_3, VAR_17,

                                            VAR_16, NULL, NULL, NULL, NULL, NULL, 0, VAR_0);

                if (VAR_14 < 0) {

                    av_log(VAR_0, AV_LOG_ERROR, "Unable to parse option value \"%s\"\n", VAR_3);

                    return VAR_14;

                }

            }

        }

        if (VAR_2->type == AV_OPT_TYPE_FLAGS) {

            read_number(VAR_2, VAR_4, NULL, NULL, &intnum);

            if      (VAR_11 == '+') VAR_12 = intnum | (int64_t)VAR_12;

            else if (VAR_11 == '-') VAR_12 = intnum &~(int64_t)VAR_12;

        }



        if ((VAR_5 = write_number(VAR_0, VAR_2, VAR_4, VAR_12, 1, 1)) < 0)

            return VAR_5;

        VAR_3 += VAR_9;

        if (!VAR_9 || !*VAR_3)

            return 0;

    }



    return 0;

}

static int FUNC_0(void *VAR_0, void *VAR_1, const AVOption *VAR_2, const char *VAR_3, void *VAR_4)
{ int VAR_5 = 0; int VAR_6, VAR_7; char VAR_8; if (sscanf(VAR_3, "%VAR_12%*1[:/]%VAR_12%VAR_8", &VAR_6, &VAR_7, &VAR_8) == 2) { if ((VAR_5 = write_number(VAR_0, VAR_2, VAR_4, 1, VAR_7, VAR_6)) >= 0)
return VAR_5; VAR_5 = 0; } for (;;) { int VAR_9 = 0; char VAR_10[256]; int VAR_11 = 0; double VAR_12; int64_t intnum = 1; if (VAR_2->type == AV_OPT_TYPE_FLAGS) { if (*VAR_3 == '+' || *VAR_3 == '-')
VAR_11 = *(VAR_3++); for (; VAR_9 < sizeof(VAR_10) - 1 && VAR_3[VAR_9] && VAR_3[VAR_9] != '+' && VAR_3[VAR_9] != '-'; VAR_9++) VAR_10[VAR_9] = VAR_3[VAR_9]; VAR_10[VAR_9] = 0; } { const AVOption *VAR_13 = av_opt_find(VAR_1, VAR_10, VAR_2->unit, 0, 0); int VAR_14; int VAR_15 = 0; double VAR_16[64]; const char * VAR_17[64]; if (VAR_13 && VAR_13->type == AV_OPT_TYPE_CONST)
VAR_12 = DEFAULT_NUMVAL(VAR_13); else { if (VAR_2->unit) { for (VAR_13 = NULL; VAR_13 = av_opt_next(VAR_1, VAR_13); ) { if (VAR_13->type == AV_OPT_TYPE_CONST &&
VAR_13->unit &&
!strcmp(VAR_13->unit, VAR_2->unit)) { if (VAR_15 + 6 >= FF_ARRAY_ELEMS(VAR_16)) { av_log(VAR_0, AV_LOG_ERROR, "VAR_16 array too small for %s\n", VAR_2->unit); return AVERROR_PATCHWELCOME; } VAR_17 [VAR_15  ] = VAR_13->name; VAR_16[VAR_15++] = DEFAULT_NUMVAL(VAR_13); } } } VAR_17 [VAR_15  ] = "default"; VAR_16[VAR_15++] = DEFAULT_NUMVAL(VAR_2); VAR_17 [VAR_15  ] = "max"; VAR_16[VAR_15++] = VAR_2->max; VAR_17 [VAR_15  ] = "min"; VAR_16[VAR_15++] = VAR_2->min; VAR_17 [VAR_15  ] = "none"; VAR_16[VAR_15++] = 0; VAR_17 [VAR_15  ] = "all"; VAR_16[VAR_15++] = ~0; VAR_17 [VAR_15] = NULL; VAR_16[VAR_15] = 0; VAR_14 = av_expr_parse_and_eval(&VAR_12, VAR_9 ? VAR_10 : VAR_3, VAR_17,
VAR_16, NULL, NULL, NULL, NULL, NULL, 0, VAR_0); if (VAR_14 < 0) { av_log(VAR_0, AV_LOG_ERROR, "Unable to parse option value \"%s\"\n", VAR_3); return VAR_14; } } } if (VAR_2->type == AV_OPT_TYPE_FLAGS) { read_number(VAR_2, VAR_4, NULL, NULL, &intnum); if      (VAR_11 == '+') VAR_12 = intnum | (int64_t)VAR_12; else if (VAR_11 == '-') VAR_12 = intnum &~(int64_t)VAR_12; } if ((VAR_5 = write_number(VAR_0, VAR_2, VAR_4, VAR_12, 1, 1)) < 0)
return VAR_5; VAR_3 += VAR_9; if (!VAR_9 || !*VAR_3)
return 0; } return 0; }