[MPlayer-dev-eng] vop scale patch (proposal)

Bohdan Horst nexus at hoth.amu.edu.pl
Sat May 18 18:39:17 CEST 2002


--- vf_scale.c  Mon May 13 09:07:29 2002
+++ vf_scale.c  Sat May 18 18:20:11 2002
@@ -86,9 +86,11 @@

     // calculate the missing parameters:
     if(vf->priv->w<0) vf->priv->w=width; else
-    if(vf->priv->w==0) vf->priv->w=d_width;
+    if(vf->priv->w==0) vf->priv->w=d_width; else
+    if(vf->priv->w==1) vf->priv->w=vf->priv->h*((float)width/(float)height);
     if(vf->priv->h<0) vf->priv->h=height; else
-    if(vf->priv->h==0) vf->priv->h=d_height;
+    if(vf->priv->h==0) vf->priv->h=d_height; else
+    if(vf->priv->h==1) vf->priv->h=vf->priv->w*((float)height/(float)width);

     printf("SwScale scaling %dx%d %s to %dx%d %s  \n",
        width,height,vo_format_name(outfmt),


with -vop scale=W:1 or -vop scale=1:H  this patch will autocalculate WxH
with keep aspect (maybe "1" isn't best choice for this :)

best regards

-- 
 / irl:Bohdan 'Nexus' Horst | mailto:nexus at irc.pl | irc:Nexus \
{---------------------------^----------v----------^------------}
 \ http://www.physd.amu.edu.pl/~nexus/ | Instytut Fizyki  UAM /



More information about the MPlayer-dev-eng mailing list