diff options
author | wm4 <wm4@nowhere> | 2014-08-06 20:00:26 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-08-06 20:30:47 +0200 |
commit | 77ad49411af12f023e37a96bf0a3111791c67f2c (patch) | |
tree | 0f107261a8e2c077f40e6c80aa730772348cc58f /video/out/vo_direct3d.c | |
parent | 64e1132d39c7124d1f7376e49a311d34a636cb26 (diff) | |
download | mpv-77ad49411af12f023e37a96bf0a3111791c67f2c.tar.bz2 mpv-77ad49411af12f023e37a96bf0a3111791c67f2c.tar.xz |
win32: never call GetClientRect(0, ...)
Sometimes GetClientRect() appeared to fail during init, and since we
don't check GetClientRect() calls (because they're on our own window,
and logically can never fail), bogus resizes were triggered. This could
cause vo_direct3d to fail initialization.
The reason was that w32->window was set to 0 during early window
initialization: CreateWindow*() can send messages to the new window,
even though it hasn't returned yet. This means w32->window is not yet
set to our window handle, and functions in WndProc may accidentally pass
hwnd=0 to win32 API functions.
Fix it by initializing w32->window on opportunity. This also means we
always strictly expect that the WndProc is used with our own window
only.
Diffstat (limited to 'video/out/vo_direct3d.c')
-rw-r--r-- | video/out/vo_direct3d.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/video/out/vo_direct3d.c b/video/out/vo_direct3d.c index 032454eb3f..34ddafdd1e 100644 --- a/video/out/vo_direct3d.c +++ b/video/out/vo_direct3d.c @@ -772,7 +772,8 @@ static bool resize_d3d(d3d_priv *priv) { D3DVIEWPORT9 vp = {0, 0, priv->vo->dwidth, priv->vo->dheight, 0, 1}; - MP_VERBOSE(priv, "resize_d3d called.\n"); + MP_VERBOSE(priv, "resize_d3d %dx%d called.\n", + priv->vo->dwidth, priv->vo->dheight); /* Make sure that backbuffer is large enough to accomodate the new viewport dimensions. Grow it if necessary. */ |