[vlc-devel] commit: XCB-X11: fix iterating visual types at different depth ( Rémi Denis-Courmont )

git version control git at videolan.org
Mon Sep 14 18:12:22 CEST 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Sep 14 19:11:46 2009 +0300| [bdf005c4644fc91514469f38bf5c5df567059fe2] | committer: Rémi Denis-Courmont 

XCB-X11: fix iterating visual types at different depth

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

 modules/video_output/xcb/x11.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/modules/video_output/xcb/x11.c b/modules/video_output/xcb/x11.c
index 3c93a1b..5f71300 100644
--- a/modules/video_output/xcb/x11.c
+++ b/modules/video_output/xcb/x11.c
@@ -195,23 +195,22 @@ static int Open (vlc_object_t *obj)
         {
             if (vt->_class == XCB_VISUAL_CLASS_TRUE_COLOR)
             {
-                vid = vt->visual_id;
                 gray = false;
-                break;
+                goto found_vt;
             }
             if (fmt->depth == 8 && vt->_class == XCB_VISUAL_CLASS_STATIC_GRAY)
             {
                 if (!gray)
                     continue; /* Prefer color over gray scale */
-                vid = vt->visual_id;
                 chroma = VLC_CODEC_GREY;
+                goto found_vt;
             }
         }
+        continue; /* The screen does not *really* support this depth */
 
-        if (!vid)
-            continue; /* The screen does not *really* support this depth */
-
+    found_vt:
         fmt_pic.i_chroma = chroma;
+        vid = vt->visual_id;
         if (!gray)
         {
             fmt_pic.i_rmask = vt->red_mask;
@@ -229,7 +228,8 @@ static int Open (vlc_object_t *obj)
         goto error;
     }
 
-    msg_Dbg (vd, "using X11 visual ID 0x%"PRIx32, vid);
+    msg_Dbg (vd, "using X11 visual ID 0x%"PRIx32" (depth: %"PRIu8")", vid,
+             p_sys->depth);
     msg_Dbg (vd, " %"PRIu8" bits per pixels, %"PRIu8" bits line pad",
              p_sys->bpp, p_sys->pad);
 




More information about the vlc-devel mailing list