From 4cb6458382b2def186eac421fbe14da60cbcb553 Mon Sep 17 00:00:00 2001 From: arpi Date: Sun, 19 May 2002 23:39:42 +0000 Subject: [PATCH] new special w/h values: -2 and -3. based on proposal by Bohdan Horst git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6127 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vf_scale.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libmpcodecs/vf_scale.c b/libmpcodecs/vf_scale.c index 73c58574d8..38fc5d61de 100644 --- a/libmpcodecs/vf_scale.c +++ b/libmpcodecs/vf_scale.c @@ -85,8 +85,13 @@ static int config(struct vf_instance_s* vf, } // 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;