diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-02-02 17:22:07 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-02-02 17:22:07 +0000 |
commit | 8b068da7ad4cac7ebdb39bf645a53c44f2cf88b8 (patch) | |
tree | cb590f39ba0e58946ffcb580172cabd76c7c0205 /libvo | |
parent | 949787e4102e9a2ab3636b48413cfa55d3bb313a (diff) | |
download | mpv-8b068da7ad4cac7ebdb39bf645a53c44f2cf88b8.tar.bz2 mpv-8b068da7ad4cac7ebdb39bf645a53c44f2cf88b8.tar.xz |
Implement keepaspect for Windows OpenGL vos.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25950 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r-- | libvo/w32_common.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libvo/w32_common.c b/libvo/w32_common.c index c7f835c64f..ab1c245055 100644 --- a/libvo/w32_common.c +++ b/libvo/w32_common.c @@ -61,6 +61,18 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l 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); |