diff options
author | wm4 <wm4@nowhere> | 2015-02-26 09:26:28 +0100 |
---|---|---|
committer | Diogo Franco (Kovensky) <diogomfranco@gmail.com> | 2015-03-03 15:58:28 +0900 |
commit | 3fc0c189974cb09b8cfe335cc0810c61447dc1fb (patch) | |
tree | 8d59a20b11f204234dc2167d677924516582e3fd | |
parent | 7fe9126bbaeef36511f906a58ddbbbac30fc4ba1 (diff) | |
download | mpv-3fc0c189974cb09b8cfe335cc0810c61447dc1fb.tar.bz2 mpv-3fc0c189974cb09b8cfe335cc0810c61447dc1fb.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.
(cherry picked from commit a2e0cd7f251f0c1750bbe7adaff6d408ae7dcd37)
-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, |