[vlc-commits] xcb/x11: cosmetic, reindent

Rémi Denis-Courmont git at videolan.org
Sun Dec 9 20:46:06 CET 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Dec  9 20:15:25 2018 +0200| [6a33cd10a46c472c2074bc4cbfa5abdca8f3aafd] | committer: Rémi Denis-Courmont

xcb/x11: cosmetic, reindent

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6a33cd10a46c472c2074bc4cbfa5abdca8f3aafd
---

 modules/video_output/xcb/x11.c | 65 ++++++++++++++++++++++--------------------
 1 file changed, 34 insertions(+), 31 deletions(-)

diff --git a/modules/video_output/xcb/x11.c b/modules/video_output/xcb/x11.c
index 1f0c457d03..c65e062aae 100644
--- a/modules/video_output/xcb/x11.c
+++ b/modules/video_output/xcb/x11.c
@@ -121,39 +121,42 @@ static void Display (vout_display_t *vd, picture_t *pic)
 
     vlc_xcb_Manage(vd, sys->conn, &sys->visible);
 
-    if (!sys->visible)
-        return;
-    if (segment != 0)
-        ck = xcb_shm_put_image_checked(sys->conn, sys->window, sys->gc,
-          /* real width */ pic->p->i_pitch / pic->p->i_pixel_pitch,
-         /* real height */ pic->p->i_lines,
-                   /* x */ sys->fmt.i_x_offset,
-                   /* y */ sys->fmt.i_y_offset,
-               /* width */ sys->fmt.i_visible_width,
-              /* height */ sys->fmt.i_visible_height,
-                           0, 0, sys->depth, XCB_IMAGE_FORMAT_Z_PIXMAP,
-                           0, segment, 0);
-    else
+    if (sys->visible)
     {
-        const size_t offset = sys->fmt.i_y_offset * pic->p->i_pitch;
-        const unsigned lines = pic->p->i_lines - sys->fmt.i_y_offset;
-
-        ck = xcb_put_image_checked(sys->conn, XCB_IMAGE_FORMAT_Z_PIXMAP,
-                           sys->window, sys->gc,
-                           pic->p->i_pitch / pic->p->i_pixel_pitch,
-                           lines, -sys->fmt.i_x_offset, 0, 0, sys->depth,
-                           pic->p->i_pitch * lines, pic->p->p_pixels + offset);
-    }
+        if (segment != 0)
+            ck = xcb_shm_put_image_checked(sys->conn, sys->window, sys->gc,
+              /* real width */ pic->p->i_pitch / pic->p->i_pixel_pitch,
+             /* real height */ pic->p->i_lines,
+                       /* x */ sys->fmt.i_x_offset,
+                       /* y */ sys->fmt.i_y_offset,
+                   /* width */ sys->fmt.i_visible_width,
+                  /* height */ sys->fmt.i_visible_height,
+                               0, 0, sys->depth, XCB_IMAGE_FORMAT_Z_PIXMAP,
+                               0, segment, 0);
+        else
+        {
+            const size_t offset = sys->fmt.i_y_offset * pic->p->i_pitch;
+            const unsigned lines = pic->p->i_lines - sys->fmt.i_y_offset;
+
+            ck = xcb_put_image_checked(sys->conn, XCB_IMAGE_FORMAT_Z_PIXMAP,
+                               sys->window, sys->gc,
+                               pic->p->i_pitch / pic->p->i_pixel_pitch,
+                               lines, -sys->fmt.i_x_offset, 0, 0, sys->depth,
+                               pic->p->i_pitch * lines,
+                               pic->p->p_pixels + offset);
+        }
 
-    /* Wait for reply. This makes sure that the X server gets CPU time to
-     * display the picture. xcb_flush() is *not* sufficient: especially with
-     * shared memory the PUT requests are so short that many of them can fit in
-     * X11 socket output buffer before the kernel preempts VLC. */
-    xcb_generic_error_t *e = xcb_request_check(sys->conn, ck);
-    if (e != NULL)
-    {
-        msg_Dbg(vd, "%s: X11 error %d", "cannot put image", e->error_code);
-        free(e);
+        /* Wait for reply. This makes sure that the X server gets CPU time to
+         * display the picture. xcb_flush() is *not* sufficient: especially
+         * with shared memory the PUT requests are so short that many of them
+         * can fit in X11 socket output buffer before the kernel preempts VLC.
+         */
+        xcb_generic_error_t *e = xcb_request_check(sys->conn, ck);
+        if (e != NULL)
+        {
+            msg_Dbg(vd, "%s: X11 error %d", "cannot put image", e->error_code);
+            free(e);
+        }
     }
 
     /* FIXME might be WAY better to wait in some case (be carefull with



More information about the vlc-commits mailing list