summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-05-01 14:15:05 +0000
committerpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-05-01 14:15:05 +0000
commit46a390a5885dc9a9995f876924ed3ee032230acc (patch)
tree5fdc95e436398b9f8b3218379320c6c5cba967a1 /libmpcodecs
parentd929c016720891e49324f386f302f735b440094c (diff)
downloadmpv-46a390a5885dc9a9995f876924ed3ee032230acc.tar.bz2
mpv-46a390a5885dc9a9995f876924ed3ee032230acc.tar.xz
expand=-1:-50:0:0 -> mwidth:mheight+50:0:0
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5922 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/vf_expand.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libmpcodecs/vf_expand.c b/libmpcodecs/vf_expand.c
index 3bb1f87bd4..0d4030adfb 100644
--- a/libmpcodecs/vf_expand.c
+++ b/libmpcodecs/vf_expand.c
@@ -145,8 +145,17 @@ static int config(struct vf_instance_s* vf,
unsigned int flags, unsigned int outfmt){
int ret;
// calculate the missing parameters:
+#if 0
if(vf->priv->exp_w<width) vf->priv->exp_w=width;
if(vf->priv->exp_h<height) vf->priv->exp_h=height;
+#else
+ if ( vf->priv->exp_w == -1 ) vf->priv->exp_w=width;
+ else if (vf->priv->exp_w < -1 ) vf->priv->exp_w=width - vf->priv->exp_w;
+ else if ( vf->priv->exp_w<width ) vf->priv->exp_w=width;
+ if ( vf->priv->exp_h == -1 ) vf->priv->exp_h=height;
+ else if ( vf->priv->exp_h < -1 ) vf->priv->exp_h=height - vf->priv->exp_h;
+ else if( vf->priv->exp_h<height ) vf->priv->exp_h=height;
+#endif
if(vf->priv->exp_x<0 || vf->priv->exp_x+width>vf->priv->exp_w) vf->priv->exp_x=(vf->priv->exp_w-width)/2;
if(vf->priv->exp_y<0 || vf->priv->exp_y+height>vf->priv->exp_h) vf->priv->exp_y=(vf->priv->exp_h-height)/2;
vf->priv->fb_ptr=NULL;