changeset 6003:28f800545e63

w/h=0 means d_w/h instead of original
author arpi
date Mon, 06 May 2002 22:50:02 +0000
parents ba14193cc935
children 0aa2d199088d
files libmpcodecs/vf_scale.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf_scale.c	Mon May 06 22:49:31 2002 +0000
+++ b/libmpcodecs/vf_scale.c	Mon May 06 22:50:02 2002 +0000
@@ -82,8 +82,10 @@
     }
 
     // calculate the missing parameters:
-    if(vf->priv->w<=0) vf->priv->w=width;
-    if(vf->priv->h<=0) vf->priv->h=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<0) vf->priv->h=height; else
+    if(vf->priv->h==0) vf->priv->h=d_height;
     
     printf("SwScale scaling %dx%d %s to %dx%d %s  \n",
 	width,height,vo_format_name(outfmt),
@@ -103,6 +105,7 @@
 	return 0;
     }
     vf->priv->fmt=best;
+    
     return vf_next_config(vf,vf->priv->w,vf->priv->h,d_width,d_height,flags,best);
 }
 
@@ -169,7 +172,7 @@
     if(args) sscanf(args, "%d:%d",
     &vf->priv->w,
     &vf->priv->h);
-    printf("SwScale: %d x %d\n",
+    printf("SwScale: %d x %d (-1=no scaling)\n",
     vf->priv->w,
     vf->priv->h);
     return 1;