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.
This commit is contained in:
wm4 2015-02-26 09:26:28 +01:00
parent 633147c959
commit a2e0cd7f25
1 changed files with 2 additions and 0 deletions

View File

@ -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,