comparison opt.c @ 6853:9bfb69f1739e libavcodec

Anoter try to make +- behave sanely.
author michael
date Sat, 24 May 2008 12:58:20 +0000
parents 80ebdc755fa9
children 322023e630a6
comparison
equal deleted inserted replaced
6852:84dc84916bab 6853:9bfb69f1739e
144 *dst = bin; 144 *dst = bin;
145 *lendst = len; 145 *lendst = len;
146 return o; 146 return o;
147 } 147 }
148 if(o->type != FF_OPT_TYPE_STRING){ 148 if(o->type != FF_OPT_TYPE_STRING){
149 int notfirst=0;
149 for(;;){ 150 for(;;){
150 int i; 151 int i;
151 char buf[256]; 152 char buf[256];
152 int cmd=0; 153 int cmd=0;
153 double d; 154 double d;
178 } 179 }
179 if(o->type == FF_OPT_TYPE_FLAGS){ 180 if(o->type == FF_OPT_TYPE_FLAGS){
180 if (cmd=='+') d= av_get_int(obj, name, NULL) | (int64_t)d; 181 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; 182 else if(cmd=='-') d= av_get_int(obj, name, NULL) &~(int64_t)d;
182 }else{ 183 }else{
183 if (cmd=='+') d= av_get_double(obj, name, NULL) + d; 184 if (cmd=='+') d= notfirst*av_get_double(obj, name, NULL) + d;
184 else if(cmd=='-') d= av_get_double(obj, name, NULL) - d; 185 else if(cmd=='-') d= notfirst*av_get_double(obj, name, NULL) - d;
185 } 186 }
186 187
187 if (!av_set_number(obj, name, d, 1, 1)) 188 if (!av_set_number(obj, name, d, 1, 1))
188 return NULL; 189 return NULL;
189 val+= i; 190 val+= i;
190 if(!*val) 191 if(!*val)
191 return o; 192 return o;
193 notfirst=1;
192 } 194 }
193 return NULL; 195 return NULL;
194 } 196 }
195 197
196 memcpy(((uint8_t*)obj) + o->offset, &val, sizeof(val)); 198 memcpy(((uint8_t*)obj) + o->offset, &val, sizeof(val));