From 9fe737aa808220c5f758ca14990bb7c3049855b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Borel?= Date: Wed, 18 Oct 2000 02:42:43 +0000 Subject: [PATCH] * Modification du module gnome pour l'output sous Xfree4 (detection 16bits). --- plugins/gnome/vout_gnome.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/gnome/vout_gnome.c b/plugins/gnome/vout_gnome.c index c9335b16d0..75c0da19a7 100644 --- a/plugins/gnome/vout_gnome.c +++ b/plugins/gnome/vout_gnome.c @@ -411,11 +411,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 ); p_vout->i_bytes_per_pixel = 0; + + /* Under XFree 4, XListPixmapFormats returns a list of available + * formats under each screen depth ; so we have to select the one + * for the current display. */ for( ; i_count--; p_xpixmap_format++ ) { - if( p_xpixmap_format->bits_per_pixel / 8 > p_vout->i_bytes_per_pixel ) + if( p_vout->i_screen_depth == p_xpixmap_format->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;