mirror of
https://github.com/mpv-player/mpv
synced 2024-12-12 01:46:16 +00:00
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:
parent
633147c959
commit
a2e0cd7f25
@ -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 ||
|
if (ctx->xv_ck_info.method == CK_METHOD_MANUALFILL ||
|
||||||
ctx->xv_ck_info.method == CK_METHOD_BACKGROUND)
|
ctx->xv_ck_info.method == CK_METHOD_BACKGROUND)
|
||||||
{
|
{
|
||||||
|
if (!x11->vo_gc)
|
||||||
|
return;
|
||||||
//less tearing than XClearWindow()
|
//less tearing than XClearWindow()
|
||||||
XSetForeground(x11->display, x11->vo_gc, ctx->xv_colorkey);
|
XSetForeground(x11->display, x11->vo_gc, ctx->xv_colorkey);
|
||||||
XFillRectangle(x11->display, x11->window, x11->vo_gc, rc->x0, rc->y0,
|
XFillRectangle(x11->display, x11->window, x11->vo_gc, rc->x0, rc->y0,
|
||||||
|
Loading…
Reference in New Issue
Block a user