summaryrefslogtreecommitdiffstats
path: root/video/out/vo_vaapi.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-09-30 23:31:34 +0200
committerwm4 <wm4@nowhere>2015-09-30 23:31:34 +0200
commit7c5f41ff5f00a823f4c75b7d9799729a05f943c9 (patch)
treefddccdae40ceacd75e886d5c665ad1bb34d2d746 /video/out/vo_vaapi.c
parenta2a2cdb5bc7788012d3976a4d2f3650e58f9f466 (diff)
downloadmpv-7c5f41ff5f00a823f4c75b7d9799729a05f943c9.tar.bz2
mpv-7c5f41ff5f00a823f4c75b7d9799729a05f943c9.tar.xz
x11: separate window creation and configuration
This gets rid of an old hack, VOFLAG_HIDDEN. Although handling of it has been sane for a while, it used to cause much pain, and is still unintuitive and weird even today. The main reason for this hack is that OpenGL selects a X11 Visual for you, and you're supposed to use this Visual when creating the X window for the OpenGL context. Which means the X window can't be created early in the common X11 init code, but the OpenGL code needs to do something before that. API-wise you need separate functions for X11 init and X11 window creation. The VOFLAG_HIDDEN hack conflated window creation and the entrypoint for resizing on video resolution change into one function, vo_x11_config_vo_window(). This required all platform backends to handle this flag, even if they didn't need this mechanism. Wayland still uses this for minor reasons (alpha support?), so the wayland backend must be changed before the flag can be entirely removed.
Diffstat (limited to 'video/out/vo_vaapi.c')
-rw-r--r--video/out/vo_vaapi.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/video/out/vo_vaapi.c b/video/out/vo_vaapi.c
index d5b035e350..413e1b7cb4 100644
--- a/video/out/vo_vaapi.c
+++ b/video/out/vo_vaapi.c
@@ -158,7 +158,7 @@ static int reconfig(struct vo *vo, struct mp_image_params *params, int flags)
free_video_specific(p);
- vo_x11_config_vo_window(vo, NULL, flags, "vaapi");
+ vo_x11_config_vo_window(vo);
if (params->imgfmt != IMGFMT_VAAPI) {
if (!alloc_swdec_surfaces(p, params->w, params->h, params->imgfmt))
@@ -577,6 +577,9 @@ static int preinit(struct vo *vo)
if (!vo_x11_init(vo))
goto fail;
+ if (!vo_x11_create_vo_window(vo, NULL, "vaapi"))
+ goto fail;
+
p->display = vaGetDisplay(vo->x11->display);
if (!p->display)
goto fail;