if (segment != 0)
xcb_shm_put_image (p_sys->conn, p_sys->window, p_sys->gc,
/* real width */ pic->p->i_pitch / pic->p->i_pixel_pitch,
- /* real height */ pic->p->i_lines, /* x */ 0, /* y */ 0,
- /* width */ pic->p->i_visible_pitch / pic->p->i_pixel_pitch,
- /* height */ pic->p->i_visible_lines, /* x */ 0, /* y */ 0,
- p_sys->depth, XCB_IMAGE_FORMAT_Z_PIXMAP,
+ /* real height */ pic->p->i_lines,
+ /* x */ vout->fmt_out.i_x_offset,
+ /* y */ vout->fmt_out.i_y_offset,
+ /* width */ vout->fmt_out.i_visible_width,
+ /* height */ vout->fmt_out.i_visible_height,
+ 0, 0, p_sys->depth, XCB_IMAGE_FORMAT_Z_PIXMAP,
0, segment, 0);
else
+ {
+ const size_t offset = vout->fmt_out.i_y_offset * pic->p->i_pitch;
+ const unsigned lines = pic->p->i_lines - vout->fmt_out.i_y_offset;
+
xcb_put_image (p_sys->conn, XCB_IMAGE_FORMAT_Z_PIXMAP,
p_sys->window, p_sys->gc,
pic->p->i_pitch / pic->p->i_pixel_pitch,
- pic->p->i_lines, 0, 0, 0, p_sys->depth,
- pic->p->i_pitch * pic->p->i_lines, pic->p->p_pixels);
+ lines, -vout->fmt_out.i_x_offset, 0, 0, p_sys->depth,
+ pic->p->i_pitch * lines, pic->p->p_pixels + offset);
+ }
xcb_flush (p_sys->conn);
}