Commit 696b3dc2 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

XCB_xv: wait until picture is displayed

Note that this does not ensure that the SHM can be written to (we would
need to handle an event for this).
parent e7b9d161
...@@ -593,10 +593,11 @@ static void Display (vout_display_t *vd, picture_t *pic) ...@@ -593,10 +593,11 @@ static void Display (vout_display_t *vd, picture_t *pic)
{ {
vout_display_sys_t *p_sys = vd->sys; vout_display_sys_t *p_sys = vd->sys;
xcb_shm_seg_t segment = pic->p_sys->segment; xcb_shm_seg_t segment = pic->p_sys->segment;
xcb_void_cookie_t ck;
if (segment) if (segment)
xcb_xv_shm_put_image (p_sys->conn, p_sys->port, p_sys->window, ck = xcb_xv_shm_put_image_checked (p_sys->conn, p_sys->port,
p_sys->gc, segment, p_sys->id, 0, p_sys->window, p_sys->gc, segment, p_sys->id, 0,
/* Src: */ vd->source.i_x_offset, /* Src: */ vd->source.i_x_offset,
vd->source.i_y_offset, vd->source.i_y_offset,
vd->source.i_visible_width, vd->source.i_visible_width,
...@@ -605,7 +606,7 @@ static void Display (vout_display_t *vd, picture_t *pic) ...@@ -605,7 +606,7 @@ static void Display (vout_display_t *vd, picture_t *pic)
/* Memory: */ pic->p->i_pitch / pic->p->i_pixel_pitch, /* Memory: */ pic->p->i_pitch / pic->p->i_pixel_pitch,
pic->p->i_visible_lines, false); pic->p->i_visible_lines, false);
else else
xcb_xv_put_image (p_sys->conn, p_sys->port, p_sys->window, ck = xcb_xv_put_image_checked (p_sys->conn, p_sys->port, p_sys->window,
p_sys->gc, p_sys->id, p_sys->gc, p_sys->id,
vd->source.i_x_offset, vd->source.i_x_offset,
vd->source.i_y_offset, vd->source.i_y_offset,
...@@ -615,7 +616,14 @@ static void Display (vout_display_t *vd, picture_t *pic) ...@@ -615,7 +616,14 @@ static void Display (vout_display_t *vd, picture_t *pic)
vd->source.i_width, vd->source.i_height, vd->source.i_width, vd->source.i_height,
p_sys->data_size, pic->p->p_pixels); p_sys->data_size, pic->p->p_pixels);
xcb_flush (p_sys->conn); /* Wait for reply. See x11.c for rationale. */
xcb_generic_error_t *e = xcb_request_check (p_sys->conn, ck);
if (e != NULL)
{
msg_Dbg (vd, "%s: X11 error %d", "cannot put image", e->error_code);
free (e);
}
picture_Release (pic); picture_Release (pic);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment