]> git.sesse.net Git - mlt/commitdiff
mlt_properties.c: make arithmetic processor use floating point instead of integer...
authorddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sun, 1 Jun 2008 20:45:09 +0000 (20:45 +0000)
committerddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sun, 1 Jun 2008 20:45:09 +0000 (20:45 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@1130 d19143bc-622f-0410-bfdd-b5b2a6649095

src/framework/mlt_properties.c

index 168aff4b0c156b233049cde2f6652c5280e23506..4e3f22bd505d3495f162f62f4dd6e8838b5c81bc 100644 (file)
@@ -413,8 +413,8 @@ int mlt_properties_set( mlt_properties this, const char *name, const char *value
        }
        else if ( value[ 0 ] == '@' )
        {
-               int total = 0;
-               int current = 0;
+               double total = 0;
+               double current = 0;
                char id[ 255 ];
                char op = '+';
 
@@ -433,7 +433,7 @@ int mlt_properties_set( mlt_properties this, const char *name, const char *value
                        if ( isdigit( id[ 0 ] ) )
                                current = atof( id );
                        else
-                               current = mlt_properties_get_int( this, id );
+                               current = mlt_properties_get_double( this, id );
 
                        // Apply the operation
                        switch( op )
@@ -448,7 +448,7 @@ int mlt_properties_set( mlt_properties this, const char *name, const char *value
                                        total *= current;
                                        break;
                                case '/':
-                                       total /= current;
+                                       total = total / current;
                                        break;
                        }
 
@@ -456,7 +456,7 @@ int mlt_properties_set( mlt_properties this, const char *name, const char *value
                        op = *value != '\0' ? *value ++ : ' ';
                }
 
-               error = mlt_property_set_int( property, total );
+               error = mlt_property_set_double( property, total );
                mlt_properties_do_mirror( this, name );
        }