From: ddennedy Date: Sun, 1 Jun 2008 20:45:09 +0000 (+0000) Subject: mlt_properties.c: make arithmetic processor use floating point instead of integer... X-Git-Url: http://research.m1stereo.tv/gitweb?a=commitdiff_plain;h=cee6a62534f2549e343a1b7c489a967577852fc6;p=melted mlt_properties.c: make arithmetic processor use floating point instead of integer so that '/' is meaningful. I am not totally certain of the consequences of this change because I am not aware of where the feature is used. However, I am using it to specify the aspect ratio of certain things like bitmap graphics that were not designed for square pixels. And being able to specify a fraction allows for accurate detection of equivalent aspect ratios between different sources, particularly compositing. git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@1130 d19143bc-622f-0410-bfdd-b5b2a6649095 --- diff --git a/src/framework/mlt_properties.c b/src/framework/mlt_properties.c index 168aff4..4e3f22b 100644 --- a/src/framework/mlt_properties.c +++ b/src/framework/mlt_properties.c @@ -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 ); }