[MPlayer-cvslog] r25950 - trunk/libvo/w32_common.c

reimar subversion at mplayerhq.hu
Sat Feb 2 18:22:08 CET 2008


Author: reimar
Date: Sat Feb  2 18:22:07 2008
New Revision: 25950

Log:
Implement keepaspect for Windows OpenGL vos.

Modified:
   trunk/libvo/w32_common.c

Modified: trunk/libvo/w32_common.c
==============================================================================
--- trunk/libvo/w32_common.c	(original)
+++ trunk/libvo/w32_common.c	Sat Feb  2 18:22:07 2008
@@ -61,6 +61,18 @@ static LRESULT CALLBACK WndProc(HWND hWn
             vo_dheight = r.bottom;
             break;
         case WM_WINDOWPOSCHANGING:
+            if (vo_keepaspect && !vo_fs) {
+              WINDOWPOS *wpos = lParam;
+              int xborder, yborder;
+              RECT r2;
+              GetClientRect(vo_window, &r);
+              GetWindowRect(vo_window, &r2);
+              xborder = (r2.right - r2.left) - (r.right - r.left);
+              yborder = (r2.bottom - r2.top) - (r.bottom - r.top);
+              wpos->cx -= xborder; wpos->cy -= yborder;
+              aspect_fit(&wpos->cx, &wpos->cy, wpos->cx, wpos->cy);
+              wpos->cx += xborder; wpos->cy += yborder;
+            }
             return 0;
         case WM_CLOSE:
             mplayer_put_key(KEY_CLOSE_WIN);



More information about the MPlayer-cvslog mailing list