changeset 6126:35eb2b9c7d9c

new special w/h values: -2 and -3. based on proposal by Bohdan Horst <nexus@hoth.amu.edu.pl>
author arpi
date Sun, 19 May 2002 23:39:42 +0000
parents 018a0d7dddd4
children b98492924d99
files libmpcodecs/vf_scale.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf_scale.c	Sun May 19 23:31:10 2002 +0000
+++ b/libmpcodecs/vf_scale.c	Sun May 19 23:39:42 2002 +0000
@@ -85,8 +85,13 @@
     }
 
     // calculate the missing parameters:
+    if(vf->priv->w==-3) vf->priv->w=vf->priv->h*width/height; else
+    if(vf->priv->w==-2) vf->priv->w=vf->priv->h*d_width/d_height;
     if(vf->priv->w<0) vf->priv->w=width; else
     if(vf->priv->w==0) vf->priv->w=d_width;
+    
+    if(vf->priv->h==-3) vf->priv->h=vf->priv->w*height/width; else
+    if(vf->priv->h==-2) vf->priv->h=vf->priv->w*d_height/d_width;
     if(vf->priv->h<0) vf->priv->h=height; else
     if(vf->priv->h==0) vf->priv->h=d_height;