comparison opt.c @ 6797:51bbc2f553e2 libavcodec

Update offset in the option string later, to have a better error message. Patch by Stefano Sabatini stefanoTODsabatini-lalaCHEZposteTODit
author benoit
date Wed, 14 May 2008 02:14:11 +0000
parents ba5913f27124
children 2854b51e7f47
comparison
equal deleted inserted replaced
6796:b03cd8d29d60 6797:51bbc2f553e2
157 cmd= *(val++); 157 cmd= *(val++);
158 158
159 for(i=0; i<sizeof(buf)-1 && val[i] && val[i]!='+' && val[i]!='-'; i++) 159 for(i=0; i<sizeof(buf)-1 && val[i] && val[i]!='+' && val[i]!='-'; i++)
160 buf[i]= val[i]; 160 buf[i]= val[i];
161 buf[i]=0; 161 buf[i]=0;
162 val+= i;
163 162
164 d = ff_eval2(buf, const_values, const_names, NULL, NULL, NULL, NULL, NULL, &error); 163 d = ff_eval2(buf, const_values, const_names, NULL, NULL, NULL, NULL, NULL, &error);
165 if(isnan(d)) { 164 if(isnan(d)) {
166 const AVOption *o_named= av_find_opt(obj, buf, o->unit, 0, 0); 165 const AVOption *o_named= av_find_opt(obj, buf, o->unit, 0, 0);
167 if(o_named && o_named->type == FF_OPT_TYPE_CONST) 166 if(o_named && o_named->type == FF_OPT_TYPE_CONST)
182 else if(cmd=='-') d= av_get_int(obj, name, NULL) &~(int64_t)d; 181 else if(cmd=='-') d= av_get_int(obj, name, NULL) &~(int64_t)d;
183 }else if(cmd=='-') 182 }else if(cmd=='-')
184 d= -d; 183 d= -d;
185 184
186 av_set_number(obj, name, d, 1, 1); 185 av_set_number(obj, name, d, 1, 1);
186 val+= i;
187 if(!*val) 187 if(!*val)
188 return o; 188 return o;
189 } 189 }
190 return NULL; 190 return NULL;
191 } 191 }