changeset 20561:b7ed249cbc6e

Do not modify parsed command-line values on config, use a local variable instead.
author reimar
date Wed, 01 Nov 2006 10:52:23 +0000
parents 5b4b6088992b
children 25c9cd2ac456
files libmpcodecs/vf_expand.c
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf_expand.c	Wed Nov 01 10:49:52 2006 +0000
+++ b/libmpcodecs/vf_expand.c	Wed Nov 01 10:52:23 2006 +0000
@@ -184,11 +184,12 @@
         else if( vf->priv->exp_h<height ) vf->priv->exp_h=height;
 #endif
     if (vf->priv->aspect) {
-        vf->priv->aspect *= ((double)width/height) / ((double)d_width/d_height);
-        if (vf->priv->exp_h < vf->priv->exp_w / vf->priv->aspect) {
-            vf->priv->exp_h = vf->priv->exp_w / vf->priv->aspect + 0.5;
+        float adjusted_aspect = vf->priv->aspect;
+        adjusted_aspect *= ((double)width/height) / ((double)d_width/d_height);
+        if (vf->priv->exp_h < vf->priv->exp_w / adjusted_aspect) {
+            vf->priv->exp_h = vf->priv->exp_w / adjusted_aspect + 0.5;
         } else {
-            vf->priv->exp_w = vf->priv->exp_h * vf->priv->aspect + 0.5;
+            vf->priv->exp_w = vf->priv->exp_h * adjusted_aspect + 0.5;
         }
     }
     if (vf->priv->round > 1) { // round up.