summaryrefslogtreecommitdiffstats
path: root/libvo/geometry.c
diff options
context:
space:
mode:
authorattila <attila@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-10-15 15:17:09 +0000
committerattila <attila@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-10-15 15:17:09 +0000
commit092de8005d80e1286a8181bba0d5a52b0f0d1a0f (patch)
treec62bc581e350ad0655349bdbfa4b19542e8916a6 /libvo/geometry.c
parent203de581958a4d22e1a02f9643f2d78d8ac1713b (diff)
downloadmpv-092de8005d80e1286a8181bba0d5a52b0f0d1a0f.tar.bz2
mpv-092de8005d80e1286a8181bba0d5a52b0f0d1a0f.tar.xz
fix aspect hack
now geometry sets geometry_wh_changed when either width or height is changed. aspect is still preserved in fullscreen git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11126 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/geometry.c')
-rw-r--r--libvo/geometry.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/libvo/geometry.c b/libvo/geometry.c
index 8c24d7b6cb..e8aafcbe5d 100644
--- a/libvo/geometry.c
+++ b/libvo/geometry.c
@@ -7,6 +7,8 @@
/* A string of the form [WxH][+X+Y] or xpos[%]:ypos[%] */
char *vo_geometry = NULL;
+// set when either width or height is changed
+int geometry_wh_changed = 0;
#define RESET_GEOMETRY width = height = xoff = yoff = xper = yper = -1;
@@ -69,15 +71,20 @@ int geometry(int *xpos, int *ypos, int *widw, int *widh, int scrw, int scrh)
" widh: %i, scrw: %i, scrh: %i\n",*widw, *widh, scrw, scrh);
/* FIXME: better checking of bounds... */
- if(width < 0 || width > scrw) width = (scrw < *widw) ? scrw : *widw;
- if(height < 0 || height > scrh) height = (scrh < *widh) ? scrh : *widh;
- if(xoff < 0 || xoff + width > scrw) xoff = 0;
- if(yoff < 0 || yoff + height > scrh) yoff = 0;
+ if( width != -1 && (width < 0 || width > scrw))
+ width = (scrw < *widw) ? scrw : *widw;
+ if( height != -1 && (height < 0 || height > scrh))
+ height = (scrh < *widh) ? scrh : *widh;
+ if(xoff != -1 && (xoff < 0 || xoff + width > scrw)) xoff = 0;
+ if(yoff != -1 && (yoff < 0 || yoff + height > scrh)) yoff = 0;
- if(xpos) *xpos = xoff;
- if(ypos) *ypos = yoff;
- if(widw) *widw = width;
- if(widh) *widh = height;
+ if(xoff != -1 && xpos) *xpos = xoff;
+ if(yoff != -1 && ypos) *ypos = yoff;
+ if(width != -1 && widw) *widw = width;
+ if(height != -1 && widh) *widh = height;
+
+ if( width != -1 || height != -1)
+ geometry_wh_changed = 1;
}
return 1;
}