xcb_get_geometry_reply_t *geo)
{
XCBGrabContext *c = s->priv_data;
- int x = c->x, y = c->y, p_x = p->win_x, p_y = p->win_y;
+ int x = c->x, y = c->y;
int w = c->width, h = c->height, f = c->follow_mouse;
+ int p_x, p_y;
if (!p || !geo)
return AVERROR(EIO);
+ p_x = p->win_x;
+ p_y = p->win_y;
+
if (f == FOLLOW_CENTER) {
x = p_x - w / 2;
y = p_y - h / 2;
sscanf(s->filename, "+%d,%d", &c->x, &c->y);
}
- c->conn = xcb_connect(display_name, &screen_num);
+ c->conn = xcb_connect(display_name[0] ? display_name : NULL, &screen_num);
av_freep(&display_name);
if ((ret = xcb_connection_has_error(c->conn))) {
av_log(s, AV_LOG_ERROR, "Cannot open display %s, error %d.\n",
- (*s->filename) ? s->filename : "default", ret);
+ s->filename[0] ? s->filename : "default", ret);
return AVERROR(EIO);
}
setup = xcb_get_setup(c->conn);