mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-10-11 10:27:50 +08:00
Anoter try to make +- behave sanely.
Originally committed as revision 13281 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
@ -146,6 +146,7 @@ const AVOption *av_set_string(void *obj, const char *name, const char *val){
|
|||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
if(o->type != FF_OPT_TYPE_STRING){
|
if(o->type != FF_OPT_TYPE_STRING){
|
||||||
|
int notfirst=0;
|
||||||
for(;;){
|
for(;;){
|
||||||
int i;
|
int i;
|
||||||
char buf[256];
|
char buf[256];
|
||||||
@ -180,8 +181,8 @@ const AVOption *av_set_string(void *obj, const char *name, const char *val){
|
|||||||
if (cmd=='+') d= av_get_int(obj, name, NULL) | (int64_t)d;
|
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= av_get_int(obj, name, NULL) &~(int64_t)d;
|
||||||
}else{
|
}else{
|
||||||
if (cmd=='+') d= av_get_double(obj, name, NULL) + d;
|
if (cmd=='+') d= notfirst*av_get_double(obj, name, NULL) + d;
|
||||||
else if(cmd=='-') d= av_get_double(obj, name, NULL) - d;
|
else if(cmd=='-') d= notfirst*av_get_double(obj, name, NULL) - d;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!av_set_number(obj, name, d, 1, 1))
|
if (!av_set_number(obj, name, d, 1, 1))
|
||||||
@ -189,6 +190,7 @@ const AVOption *av_set_string(void *obj, const char *name, const char *val){
|
|||||||
val+= i;
|
val+= i;
|
||||||
if(!*val)
|
if(!*val)
|
||||||
return o;
|
return o;
|
||||||
|
notfirst=1;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user