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

XCB-X11: fix iterating visual types at different depth

parent b7a048f1
...@@ -195,23 +195,22 @@ static int Open (vlc_object_t *obj) ...@@ -195,23 +195,22 @@ static int Open (vlc_object_t *obj)
{ {
if (vt->_class == XCB_VISUAL_CLASS_TRUE_COLOR) if (vt->_class == XCB_VISUAL_CLASS_TRUE_COLOR)
{ {
vid = vt->visual_id;
gray = false; gray = false;
break; goto found_vt;
} }
if (fmt->depth == 8 && vt->_class == XCB_VISUAL_CLASS_STATIC_GRAY) if (fmt->depth == 8 && vt->_class == XCB_VISUAL_CLASS_STATIC_GRAY)
{ {
if (!gray) if (!gray)
continue; /* Prefer color over gray scale */ continue; /* Prefer color over gray scale */
vid = vt->visual_id;
chroma = VLC_CODEC_GREY; chroma = VLC_CODEC_GREY;
goto found_vt;
} }
} }
continue; /* The screen does not *really* support this depth */
if (!vid) found_vt:
continue; /* The screen does not *really* support this depth */
fmt_pic.i_chroma = chroma; fmt_pic.i_chroma = chroma;
vid = vt->visual_id;
if (!gray) if (!gray)
{ {
fmt_pic.i_rmask = vt->red_mask; fmt_pic.i_rmask = vt->red_mask;
...@@ -229,7 +228,8 @@ static int Open (vlc_object_t *obj) ...@@ -229,7 +228,8 @@ static int Open (vlc_object_t *obj)
goto error; 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", msg_Dbg (vd, " %"PRIu8" bits per pixels, %"PRIu8" bits line pad",
p_sys->bpp, p_sys->pad); p_sys->bpp, p_sys->pad);
......
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