diff options
author | wm4 <wm4@nowhere> | 2015-02-26 09:26:28 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-02-26 09:26:28 +0100 |
commit | a2e0cd7f251f0c1750bbe7adaff6d408ae7dcd37 (patch) | |
tree | edb59b265afb1faf4511bd5078b845df07785737 /video/out/vo_xv.c | |
parent | 633147c9596177d42d9651aaf101a426d754cb7c (diff) | |
download | mpv-a2e0cd7f251f0c1750bbe7adaff6d408ae7dcd37.tar.bz2 mpv-a2e0cd7f251f0c1750bbe7adaff6d408ae7dcd37.tar.xz |
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.
Diffstat (limited to 'video/out/vo_xv.c')
-rw-r--r-- | video/out/vo_xv.c | 2 |
1 files changed, 2 insertions, 0 deletions
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, |