From b3daf517e2885a7caef8d6c3f78c9c7cef4d4fae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Borel?= Date: Tue, 17 Oct 2000 23:42:13 +0000 Subject: [PATCH] =?UTF-8?q?.Fix=20du=20probl=EF=BF=BDme=20de=20detection?= =?UTF-8?q?=20de=20la=20profondeur=20en=2016=20bits=20sous=20XFree=204?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit J'esp�re que �a marche encore avec XFree 3.3 --- plugins/x11/vout_x11.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/plugins/x11/vout_x11.c b/plugins/x11/vout_x11.c index 7b95b33f1f..2115c34fa1 100644 --- a/plugins/x11/vout_x11.c +++ b/plugins/x11/vout_x11.c @@ -412,13 +412,18 @@ static int X11OpenDisplay( vout_thread_t *p_vout, char *psz_display, Window root * formats. */ p_xpixmap_format = XListPixmapFormats( p_vout->p_sys->p_display, &i_count ); - /* FIXME: under XFree4.0, we can get some strange values. Check this */ + + /* Under XFree4.0, the list contains pixmap formats available through + * all video depths ; so we have to check against current depth. */ p_vout->i_bytes_per_pixel = 0; - for( ; i_count--; p_xpixmap_format++ ) + for( ; i_count-- ; p_xpixmap_format++ ) { - if( p_xpixmap_format->bits_per_pixel / 8 > p_vout->i_bytes_per_pixel ) + if( p_xpixmap_format->depth == p_vout->i_screen_depth ) { - p_vout->i_bytes_per_pixel = p_xpixmap_format->bits_per_pixel / 8; + if( p_xpixmap_format->bits_per_pixel / 8 > p_vout->i_bytes_per_pixel ) + { + p_vout->i_bytes_per_pixel = p_xpixmap_format->bits_per_pixel / 8; + } } } break;