From a2e0cd7f251f0c1750bbe7adaff6d408ae7dcd37 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 26 Feb 2015 09:26:28 +0100 Subject: [PATCH] vo_xv: don't attempt to clear window before mapped This can happen with the "no-colorkey" suboption. Then the code in xv_draw_colorkey() can be run before vo_x11_config_vo_window(), when vo_gc is not allocated yet. Fixes #1629. --- video/out/vo_xv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/video/out/vo_xv.c b/video/out/vo_xv.c index 11c6efc26e..654f657ca3 100644 --- a/video/out/vo_xv.c +++ b/video/out/vo_xv.c @@ -382,6 +382,8 @@ static void xv_draw_colorkey(struct vo *vo, const struct mp_rect *rc) if (ctx->xv_ck_info.method == CK_METHOD_MANUALFILL || ctx->xv_ck_info.method == CK_METHOD_BACKGROUND) { + if (!x11->vo_gc) + return; //less tearing than XClearWindow() XSetForeground(x11->display, x11->vo_gc, ctx->xv_colorkey); XFillRectangle(x11->display, x11->window, x11->vo_gc, rc->x0, rc->y0,