diff options
author | wm4 <wm4@nowhere> | 2013-07-15 23:55:19 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-07-16 00:03:51 +0200 |
commit | cde55d4c340e4d721f2a6f78035df68f9dd27f18 (patch) | |
tree | bed7bcc050eb63c7f1e0479a27f1545f9f826a8e /video/out | |
parent | f77d243a68e2c1c86687b4ea3a69c81403c0a10c (diff) | |
download | mpv-cde55d4c340e4d721f2a6f78035df68f9dd27f18.tar.bz2 mpv-cde55d4c340e4d721f2a6f78035df68f9dd27f18.tar.xz |
w32_common: don't use aspdat.asp for aspect
aspdat.asp is a problem, because it's updated when the VO calls
vo_get_src_dst_rects(). Nothing guarantees that the value has been
updated when the w32 code accesses it.
Instead, use the aspect vo_w32_config() was called with.
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/w32_common.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/video/out/w32_common.c b/video/out/w32_common.c index 9ce0174320..b5aa899333 100644 --- a/video/out/w32_common.c +++ b/video/out/w32_common.c @@ -26,6 +26,7 @@ #include "core/input/keycodes.h" #include "core/input/input.h" #include "core/mp_msg.h" +#include "core/mp_common.h" #include "vo.h" #include "aspect.h" #include "w32_common.h" @@ -158,7 +159,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, RECT r = *rc; subtract_window_borders(w32->window, &r); int c_w = r.right - r.left, c_h = r.bottom - r.top; - float aspect = vo->aspdat.asp; + float aspect = w32->o_dwidth / (float) MPMAX(w32->o_dheight, 1); int d_w = c_h * aspect - c_w; int d_h = c_w / aspect - c_h; int d_corners[4] = { d_w, d_h, -d_w, -d_h }; |