[FFmpeg-cvslog] r13281 - trunk/libavcodec/opt.c

michael subversion
Sat May 24 14:58:20 CEST 2008


Author: michael
Date: Sat May 24 14:58:20 2008
New Revision: 13281

Log:
Anoter try to make +- behave sanely.


Modified:
   trunk/libavcodec/opt.c

Modified: trunk/libavcodec/opt.c
==============================================================================
--- trunk/libavcodec/opt.c	(original)
+++ trunk/libavcodec/opt.c	Sat May 24 14:58:20 2008
@@ -146,6 +146,7 @@ const AVOption *av_set_string(void *obj,
         return o;
     }
     if(o->type != FF_OPT_TYPE_STRING){
+        int notfirst=0;
         for(;;){
             int i;
             char buf[256];
@@ -180,8 +181,8 @@ const AVOption *av_set_string(void *obj,
                 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_double(obj, name, NULL) + d;
-                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= notfirst*av_get_double(obj, name, NULL) - d;
             }
 
             if (!av_set_number(obj, name, d, 1, 1))
@@ -189,6 +190,7 @@ const AVOption *av_set_string(void *obj,
             val+= i;
             if(!*val)
                 return o;
+            notfirst=1;
         }
         return NULL;
     }




More information about the ffmpeg-cvslog mailing list