const AVOption *av_set_string(void *obj, const char *name, const char *val){

    const AVOption *o= av_find_opt(obj, name, NULL, 0, 0);

    if(o && o->offset==0 && o->type == FF_OPT_TYPE_CONST && o->unit){

        return set_all_opt(obj, o->unit, o->default_val);

    }

    if(!o || !val || o->offset<=0)

        return NULL;

    if(o->type != FF_OPT_TYPE_STRING){

        for(;;){

            int i;

            char buf[256];

            int cmd=0;

            double d;

            char *error = NULL;



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

                cmd= *(val++);



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

                buf[i]= val[i];

            buf[i]=0;

            val+= i;



            d = ff_eval2(buf, const_values, const_names, NULL, NULL, NULL, NULL, NULL, &error);

            if(isnan(d)) {

                const AVOption *o_named= av_find_opt(obj, buf, o->unit, 0, 0);

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

                    d= o_named->default_val;

                else if(!strcmp(buf, "default")) d= o->default_val;

                else if(!strcmp(buf, "max"    )) d= o->max;

                else if(!strcmp(buf, "min"    )) d= o->min;

                else if(!strcmp(buf, "none"   )) d= 0;

                else if(!strcmp(buf, "all"    )) d= ~0;

                else {

                    if (!error)

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

                    return NULL;

                }

            }

            if(o->type == FF_OPT_TYPE_FLAGS){

                if     (cmd=='+') d= av_get_int(obj, name, NULL) | (int64_t)d;

                else if(cmd=='-') d= av_get_int(obj, name, NULL) &~(int64_t)d;

            }else if(cmd=='-')

                d= -d;



            av_set_number(obj, name, d, 1, 1);

            if(!*val)

                return o;

        }

        return NULL;

    }



    memcpy(((uint8_t*)obj) + o->offset, val, sizeof(val));

    return o;

}

const AVOption *av_set_string(void *obj, const char *name, const char *val){

    const AVOption *o= av_find_opt(obj, name, NULL, 0, 0);

    if(o && o->offset==0 && o->type == FF_OPT_TYPE_CONST && o->unit){

        return set_all_opt(obj, o->unit, o->default_val);

    }

    if(!o || !val || o->offset<=0)

        return NULL;

    if(o->type != FF_OPT_TYPE_STRING){

        for(;;){

            int i;

            char buf[256];

            int cmd=0;

            double d;

            char *error = NULL;



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

                cmd= *(val++);



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

                buf[i]= val[i];

            buf[i]=0;

            val+= i;



            d = ff_eval2(buf, const_values, const_names, NULL, NULL, NULL, NULL, NULL, &error);

            if(isnan(d)) {

                const AVOption *o_named= av_find_opt(obj, buf, o->unit, 0, 0);

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

                    d= o_named->default_val;

                else if(!strcmp(buf, "default")) d= o->default_val;

                else if(!strcmp(buf, "max"    )) d= o->max;

                else if(!strcmp(buf, "min"    )) d= o->min;

                else if(!strcmp(buf, "none"   )) d= 0;

                else if(!strcmp(buf, "all"    )) d= ~0;

                else {

                    if (!error)

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

                    return NULL;

                }

            }

            if(o->type == FF_OPT_TYPE_FLAGS){

                if     (cmd=='+') d= av_get_int(obj, name, NULL) | (int64_t)d;

                else if(cmd=='-') d= av_get_int(obj, name, NULL) &~(int64_t)d;

            }else if(cmd=='-')

                d= -d;



            av_set_number(obj, name, d, 1, 1);

            if(!*val)

                return o;

        }

        return NULL;

    }



    memcpy(((uint8_t*)obj) + o->offset, val, sizeof(val));

    return o;

}

    memcpy(((uint8_t*)obj) + o->offset, val, sizeof(val));
const AVOption *FUNC_0(void *obj, const char *name, const char *val){

    const AVOption *VAR_0= av_find_opt(obj, name, NULL, 0, 0);

    if(VAR_0 && VAR_0->offset==0 && VAR_0->type == FF_OPT_TYPE_CONST && VAR_0->unit){

        return set_all_opt(obj, VAR_0->unit, VAR_0->default_val);

    }

    if(!VAR_0 || !val || VAR_0->offset<=0)

        return NULL;

    if(VAR_0->type != FF_OPT_TYPE_STRING){

        for(;;){

            int VAR_1;

            char VAR_2[256];

            int VAR_3=0;

            double VAR_4;

            char *VAR_5 = NULL;



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

                VAR_3= *(val++);



            for(VAR_1=0; VAR_1<sizeof(VAR_2)-1 && val[VAR_1] && val[VAR_1]!='+' && val[VAR_1]!='-'; VAR_1++)

                VAR_2[VAR_1]= val[VAR_1];

            VAR_2[VAR_1]=0;

            val+= VAR_1;



            VAR_4 = ff_eval2(VAR_2, const_values, const_names, NULL, NULL, NULL, NULL, NULL, &VAR_5);

            if(isnan(VAR_4)) {

                const AVOption *VAR_6= av_find_opt(obj, VAR_2, VAR_0->unit, 0, 0);

                if(VAR_6 && VAR_6->type == FF_OPT_TYPE_CONST)

                    VAR_4= VAR_6->default_val;

                else if(!strcmp(VAR_2, "default")) VAR_4= VAR_0->default_val;

                else if(!strcmp(VAR_2, "max"    )) VAR_4= VAR_0->max;

                else if(!strcmp(VAR_2, "min"    )) VAR_4= VAR_0->min;

                else if(!strcmp(VAR_2, "none"   )) VAR_4= 0;

                else if(!strcmp(VAR_2, "all"    )) VAR_4= ~0;

                else {

                    if (!VAR_5)

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

                    return NULL;

                }

            }

            if(VAR_0->type == FF_OPT_TYPE_FLAGS){

                if     (VAR_3=='+') VAR_4= av_get_int(obj, name, NULL) | (int64_t)VAR_4;

                else if(VAR_3=='-') VAR_4= av_get_int(obj, name, NULL) &~(int64_t)VAR_4;

            }else if(VAR_3=='-')

                VAR_4= -VAR_4;



            av_set_number(obj, name, VAR_4, 1, 1);

            if(!*val)

                return VAR_0;

        }

        return NULL;

    }



    memcpy(((uint8_t*)obj) + VAR_0->offset, val, sizeof(val));

    return VAR_0;

}

const AVOption *FUNC_0(void *obj, const char *name, const char *val){ const AVOption *VAR_0= av_find_opt(obj, name, NULL, 0, 0); if(VAR_0 && VAR_0->offset==0 && VAR_0->type == FF_OPT_TYPE_CONST && VAR_0->unit){ return set_all_opt(obj, VAR_0->unit, VAR_0->default_val); } if(!VAR_0 || !val || VAR_0->offset<=0)
return NULL; if(VAR_0->type != FF_OPT_TYPE_STRING){ for(;;){ int VAR_1; char VAR_2[256]; int VAR_3=0; double VAR_4; char *VAR_5 = NULL; if(*val == '+' || *val == '-')
VAR_3= *(val++); for(VAR_1=0; VAR_1<sizeof(VAR_2)-1 && val[VAR_1] && val[VAR_1]!='+' && val[VAR_1]!='-'; VAR_1++) VAR_2[VAR_1]= val[VAR_1]; VAR_2[VAR_1]=0; val+= VAR_1; VAR_4 = ff_eval2(VAR_2, const_values, const_names, NULL, NULL, NULL, NULL, NULL, &VAR_5); if(isnan(VAR_4)) { const AVOption *VAR_6= av_find_opt(obj, VAR_2, VAR_0->unit, 0, 0); if(VAR_6 && VAR_6->type == FF_OPT_TYPE_CONST)
VAR_4= VAR_6->default_val; else if(!strcmp(VAR_2, "default")) VAR_4= VAR_0->default_val; else if(!strcmp(VAR_2, "max"    )) VAR_4= VAR_0->max; else if(!strcmp(VAR_2, "min"    )) VAR_4= VAR_0->min; else if(!strcmp(VAR_2, "none"   )) VAR_4= 0; else if(!strcmp(VAR_2, "all"    )) VAR_4= ~0; else { if (!VAR_5)
av_log(NULL, AV_LOG_ERROR, "Unable to parse option value \"%s\": %s\n", val, VAR_5); return NULL; } } if(VAR_0->type == FF_OPT_TYPE_FLAGS){ if     (VAR_3=='+') VAR_4= av_get_int(obj, name, NULL) | (int64_t)VAR_4; else if(VAR_3=='-') VAR_4= av_get_int(obj, name, NULL) &~(int64_t)VAR_4; }else if(VAR_3=='-') VAR_4= -VAR_4; av_set_number(obj, name, VAR_4, 1, 1); if(!*val)
return VAR_0; } return NULL; } memcpy(((uint8_t*)obj) + VAR_0->offset, val, sizeof(val)); return VAR_0; }