summaryrefslogtreecommitdiffstats
path: root/video/out/x11_common.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-10-01 17:12:46 +0200
committerwm4 <wm4@nowhere>2014-10-01 17:29:24 +0200
commit64fb37c173e0ecee0e62d78b96c03d609845e8a4 (patch)
tree32ae8d767f10544a529d0779152f61cc6140af34 /video/out/x11_common.c
parent7759c182cba7fa2e28f70366bb2be0fb71b7230c (diff)
downloadmpv-64fb37c173e0ecee0e62d78b96c03d609845e8a4.tar.bz2
mpv-64fb37c173e0ecee0e62d78b96c03d609845e8a4.tar.xz
vo_vdpau: don't try to create surfaces of size 0
At least on kwin, we decide to proceed without waiting for the window being mapped (due to the frame exts hack, see commit 8c002b79). But that leaves us with a window size of 0x0, which causes VdpOutputSurfaceCreate to fail. This prints some warnings, although vo_vdpau recovers later and this has no other bad consequences. Do the following things to deal with this: - set the "known" window size to the suggested window size before the window is even created - allow calling XGetGeometry on the window even if the window is not mapped yet (this should work just fine) - make the output surface minimum size 1x1 Strictly speaking, only one of these would be required to make the warning disappear, but they're all valid changes and increase robustness and correctness. At no point we use a window size of 0x0 as magic value for "unset" or unknown size, so keeping it unset has no purpose anyway. CC: @mpv-player/stable
Diffstat (limited to 'video/out/x11_common.c')
-rw-r--r--video/out/x11_common.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c
index 1c3ccb95e0..d0f86af3aa 100644
--- a/video/out/x11_common.c
+++ b/video/out/x11_common.c
@@ -1339,6 +1339,7 @@ void vo_x11_config_vo_window(struct vo *vo, XVisualInfo *vis, int flags,
vo_x11_create_window(vo, vis, rc);
vo_x11_classhint(vo, x11->window, classname);
x11->window_hidden = true;
+ x11->winrc = geo.win;
}
if (flags & VOFLAG_HIDDEN)
@@ -1453,7 +1454,7 @@ static void vo_x11_update_geometry(struct vo *vo)
int dummy_int;
Window dummy_win;
Window win = vo->opts->WinID > 0 ? vo->opts->WinID : x11->window;
- if (x11->window_hidden || !win)
+ if (!win)
return;
XGetGeometry(x11->display, win, &dummy_win, &dummy_int, &dummy_int,
&w, &h, &dummy_int, &dummy_uint);