XCB/XVideo: fix crop (fixes #10973)
authorRémi Denis-Courmont <remi@remlab.net>
Sat, 15 Mar 2014 10:49:57 +0000 (12:49 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Sat, 15 Mar 2014 11:08:30 +0000 (13:08 +0200)
modules/video_output/xcb/xvideo.c

index 0850acd..21b383f 100644 (file)
@@ -700,26 +700,26 @@ static void Display (vout_display_t *vd, picture_t *pic, subpicture_t *subpictur
     vout_display_sys_t *p_sys = vd->sys;
     xcb_shm_seg_t segment = XCB_picture_GetSegment(pic);
     xcb_void_cookie_t ck;
     vout_display_sys_t *p_sys = vd->sys;
     xcb_shm_seg_t segment = XCB_picture_GetSegment(pic);
     xcb_void_cookie_t ck;
+    video_format_t fmt;
 
     if (!p_sys->visible)
         goto out;
 
     if (!p_sys->visible)
         goto out;
+
+    video_format_ApplyRotation(&fmt, &vd->source);
+
     if (segment)
         ck = xcb_xv_shm_put_image_checked (p_sys->conn, p_sys->port,
                               p_sys->window, p_sys->gc, segment, p_sys->id, 0,
     if (segment)
         ck = xcb_xv_shm_put_image_checked (p_sys->conn, p_sys->port,
                               p_sys->window, p_sys->gc, segment, p_sys->id, 0,
-                   /* Src: */ vd->fmt.i_x_offset,
-                              vd->fmt.i_y_offset,
-                              vd->fmt.i_visible_width,
-                              vd->fmt.i_visible_height,
+                   /* Src: */ fmt.i_x_offset, fmt.i_y_offset,
+                              fmt.i_visible_width, fmt.i_visible_height,
                    /* Dst: */ 0, 0, p_sys->width, p_sys->height,
                 /* Memory: */ pic->p->i_pitch / pic->p->i_pixel_pitch,
                               pic->p->i_lines, false);
     else
         ck = xcb_xv_put_image_checked (p_sys->conn, p_sys->port, p_sys->window,
                           p_sys->gc, p_sys->id,
                    /* Dst: */ 0, 0, p_sys->width, p_sys->height,
                 /* Memory: */ pic->p->i_pitch / pic->p->i_pixel_pitch,
                               pic->p->i_lines, false);
     else
         ck = xcb_xv_put_image_checked (p_sys->conn, p_sys->port, p_sys->window,
                           p_sys->gc, p_sys->id,
-                          vd->fmt.i_x_offset,
-                          vd->fmt.i_y_offset,
-                          vd->fmt.i_visible_width,
-                          vd->fmt.i_visible_height,
+                          fmt.i_x_offset, fmt.i_y_offset,
+                          fmt.i_visible_width, fmt.i_visible_height,
                           0, 0, p_sys->width, p_sys->height,
                           pic->p->i_pitch / pic->p->i_pixel_pitch,
                           pic->p->i_lines,
                           0, 0, p_sys->width, p_sys->height,
                           pic->p->i_pitch / pic->p->i_pixel_pitch,
                           pic->p->i_lines,