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

    AVOption *o= find_opt(obj, name);

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

        return NULL;

    if(o->type != FF_OPT_TYPE_STRING){

        double d=0, tmp_d;

        for(;;){

            int i;

            char buf[256], *tail;



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

                buf[i]= val[i];

            buf[i]=0;

            val+= i;

            

            tmp_d= av_parse_num(buf, &tail);

            if(tail > buf)

                d+= tmp_d;

            else{

                AVOption *o_named= find_opt(obj, buf);

                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 return NULL;

            }



            if(*val == '+') val++;

            if(!*val)

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

        }

        return NULL;

    }

    

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

    return o;

}

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

    AVOption *o= find_opt(obj, name);

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

        return NULL;

    if(o->type != FF_OPT_TYPE_STRING){

        double d=0, tmp_d;

        for(;;){

            int i;

            char buf[256], *tail;



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

                buf[i]= val[i];

            buf[i]=0;

            val+= i;

            

            tmp_d= av_parse_num(buf, &tail);

            if(tail > buf)

                d+= tmp_d;

            else{

                AVOption *o_named= find_opt(obj, buf);

                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 return NULL;

            }



            if(*val == '+') val++;

            if(!*val)

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

        }

        return NULL;

    }

    

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

    return o;

}

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

    AVOption *o= find_opt(obj, name);

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

        return NULL;

    if(o->type != FF_OPT_TYPE_STRING){

        double VAR_0=0, VAR_1;

        for(;;){

            int VAR_2;

            char VAR_3[256], *VAR_4;



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

                VAR_3[VAR_2]= val[VAR_2];

            VAR_3[VAR_2]=0;

            val+= VAR_2;

            

            VAR_1= av_parse_num(VAR_3, &VAR_4);

            if(VAR_4 > VAR_3)

                VAR_0+= VAR_1;

            else{

                AVOption *o_named= find_opt(obj, VAR_3);

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

                    VAR_0+= o_named->default_val;

                else if(!strcmp(VAR_3, "default")) VAR_0+= o->default_val;

                else if(!strcmp(VAR_3, "max"    )) VAR_0+= o->max;

                else if(!strcmp(VAR_3, "min"    )) VAR_0+= o->min;

                else return NULL;

            }



            if(*val == '+') val++;

            if(!*val)

                return av_set_number(obj, name, VAR_0, 1, 1);

        }

        return NULL;

    }

    

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

    return o;

}

AVOption *FUNC_0(void *obj, const char *name, const char *val){ AVOption *o= find_opt(obj, name); if(!o || !val || o->offset<=0)
return NULL; if(o->type != FF_OPT_TYPE_STRING){ double VAR_0=0, VAR_1; for(;;){ int VAR_2; char VAR_3[256], *VAR_4; for(VAR_2=0; VAR_2<sizeof(VAR_3)-1 && val[VAR_2] && val[VAR_2]!='+'; VAR_2++) VAR_3[VAR_2]= val[VAR_2]; VAR_3[VAR_2]=0; val+= VAR_2; VAR_1= av_parse_num(VAR_3, &VAR_4); if(VAR_4 > VAR_3)
VAR_0+= VAR_1; else{ AVOption *o_named= find_opt(obj, VAR_3); if(o_named && o_named->type == FF_OPT_TYPE_CONST)
VAR_0+= o_named->default_val; else if(!strcmp(VAR_3, "default")) VAR_0+= o->default_val; else if(!strcmp(VAR_3, "max"    )) VAR_0+= o->max; else if(!strcmp(VAR_3, "min"    )) VAR_0+= o->min; else return NULL; } if(*val == '+') val++; if(!*val)
return av_set_number(obj, name, VAR_0, 1, 1); } return NULL; } memcpy(((uint8_t*)obj) + o->offset, val, sizeof(val)); return o; }