summaryrefslogtreecommitdiffstats
path: root/video/out/vo_vdpau.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-01-27 12:01:08 +0100
committerwm4 <wm4@nowhere>2013-01-27 13:32:27 +0100
commitdf80cd379ae2ea3fbbfd3f2a28e804b8882ea93a (patch)
tree4a29ae5b579a10baee13ee8065ad01beeefafe8f /video/out/vo_vdpau.c
parent75164a0e0a409958d10f56b3dabea35914daeba3 (diff)
downloadmpv-df80cd379ae2ea3fbbfd3f2a28e804b8882ea93a.tar.bz2
mpv-df80cd379ae2ea3fbbfd3f2a28e804b8882ea93a.tar.xz
x11: simplify handling of X Visuals and Colormaps in VOs
Don't force VOs to pick an arbitrary default Visual and Colormap. They still can override them if needed. This simplifies the X11 VO interface. Always create a Colormap for simplicity. Using CopyFromParent fails if the selected visual is not the same of that of the parent window, which happens for me with vo_opengl. vo_vdpau and vo_xv explicitly set CWBorderPixel, do that in x11_common instead (it was already done for native windows, but not for slave mode windows). What gl_common did was incorrect in theory: freeing a colormap while a window uses it will change the colormap of the window to "None", and the color mapping for such windows is "undefined".
Diffstat (limited to 'video/out/vo_vdpau.c')
-rw-r--r--video/out/vo_vdpau.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c
index 00477716b7..85bf635b11 100644
--- a/video/out/vo_vdpau.c
+++ b/video/out/vo_vdpau.c
@@ -843,11 +843,6 @@ static int config(struct vo *vo, uint32_t width, uint32_t height,
uint32_t format)
{
struct vdpctx *vc = vo->priv;
- struct vo_x11_state *x11 = vo->x11;
- XVisualInfo vinfo;
- XSetWindowAttributes xswa;
- XWindowAttributes attribs;
- unsigned long xswamask;
if (handle_preemption(vo) < 0)
return -1;
@@ -861,20 +856,8 @@ static int config(struct vo *vo, uint32_t width, uint32_t height,
if (IMGFMT_IS_VDPAU(vc->image_format) && !create_vdp_decoder(vo, 2))
return -1;
- XGetWindowAttributes(x11->display, DefaultRootWindow(x11->display),
- &attribs);
- XMatchVisualInfo(x11->display, x11->screen, attribs.depth, TrueColor,
- &vinfo);
-
- xswa.background_pixel = 0;
- xswa.border_pixel = 0;
- /* Do not use CWBackPixel: It leads to VDPAU errors after
- * aspect ratio changes. */
- xswamask = CWBorderPixel;
-
- vo_x11_create_vo_window(vo, &vinfo, vo->dx, vo->dy, d_width, d_height,
- flags, CopyFromParent, "vdpau");
- XChangeWindowAttributes(x11->display, x11->window, xswamask, &xswa);
+ vo_x11_create_vo_window(vo, NULL, vo->dx, vo->dy, d_width, d_height,
+ flags, "vdpau");
if (initialize_vdpau_objects(vo) < 0)
return -1;