[MPlayer-dev-eng] [PATCH] Allow keeping aspect at window geometry change

Konstantin Khlebnikov khlebnikov at openvz.org
Sun Oct 31 12:48:59 CET 2010


Passing zero as height tell to caltulate it from given width and original aspect.

Signed-off-by: Konstantin Khlebnikov <khlebnikov at openvz.org>
---
 libvo/geometry.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
-------------- next part --------------
diff --git a/libvo/geometry.c b/libvo/geometry.c
index 4bc08f8..e5c1e7f 100644
--- a/libvo/geometry.c
+++ b/libvo/geometry.c
@@ -90,6 +90,9 @@ int geometry(int *xpos, int *ypos, int *widw, int *widh, int scrw, int scrh)
 		  "height: %i, xoff: %s%i, yoff: %s%i, xper: %i, yper: %i\n",
 		  width, height, xsign, xoff, ysign, yoff, xper, yper);
 
+		if (height == 0 && width > 0 && widh && widw)
+			*widh = *widh * width / *widw;
+
 		if (width  > 0 && widw) *widw = width;
 		if (height > 0 && widh) *widh = height;
 


More information about the MPlayer-dev-eng mailing list