[vlc-devel] Re: Fwd: [Possible endian bug in video_chrome/video_output]

Alexander Gall gall at switch.ch
Tue May 2 10:05:52 CEST 2006

On Sat, 29 Apr 2006 15:57:00 +0200, Benjamin Pracht <bigben+spam at videolan.org> said:

> Le jeudi 27 avril 2006 à 10:32 +0200, Alexander Gall a écrit :
>> On Wed, 26 Apr 2006 18:51:24 +0200, Benjamin Pracht <bigben+spam at videolan.org> said:

>> Right.  I finally understand what's going on.  InitDisplay() correctly
>> determines the screen depth to be 24 and enters the 24/default
>> case. Now, XGetVisualInfo() is called with only the ScreenMask and
>> ClassMask flags, asking for a list of all TrueColor visuals on this
>> screen.  My screen happens to have 7 matching visuals
>> visual:
>> visual id:    0x25
>> class:    TrueColor
>> depth:    8 planes
>> available colormap entries:    8 per subfield
>> red, green, blue masks:    0x7, 0x38, 0xc0
>> significant bits in color specification:    8 bits

> That should be fixed now. 

You forgot to set the corresponding flag in the call to

--- xcommon.c.orig      2006-05-01 00:00:40.000000000 +0200
+++ xcommon.c   2006-05-02 09:39:44.588944000 +0200
@@ -2072,7 +2072,8 @@
         xvisual_template.depth =    p_vout->p_sys->i_screen_depth;
         p_xvisual = XGetVisualInfo( p_vout->p_sys->p_display,
-                                    VisualScreenMask | VisualClassMask,
+                                    VisualScreenMask | VisualClassMask
+                                    | VisualDepthMask,
                                     &xvisual_template, &i_count );
         if( p_xvisual == NULL )

This finally selects the proper visual for me in all cases :-)

> BTW, returning a 8bit display when being
> requested a truecolor one as first answer seems quite strange to me...

I think that with X11, "TrueColor" just means that a fixed color
lookup table is used to get the final color values (as opposed to
DirectColor), but it doesn't imply 24bpp.  Visuals with lower color
depth are still called TrueColor as long as they use a fixed lookup
table.  The list of visuals returned by XGetVisualInfo() has no
particular order, so I think what my system returns when asked for all
TrueColor visuals is perfectly fine.  It's up to the application to
select a visual from the list according to some other criteria.
Simply picking the first one is not a safe thing to do in general.


This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html

More information about the vlc-devel mailing list