diff options
author | jkeil <jkeil@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-09-03 18:10:42 +0000 |
---|---|---|
committer | jkeil <jkeil@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-09-03 18:10:42 +0000 |
commit | d0e59b4ff9dcd60d7d428512b02dbfe17ca0f500 (patch) | |
tree | 54a3321df34d1c8b233b5da1500ea1e64e118625 /libvo/vo_x11.c | |
parent | 3d21da3186f408bccdc4d80ea6f64774640d01f0 (diff) | |
download | mpv-d0e59b4ff9dcd60d7d428512b02dbfe17ca0f500.tar.bz2 mpv-d0e59b4ff9dcd60d7d428512b02dbfe17ca0f500.tar.xz |
Add the code that chooses a good X11 truecolor visual to the vo_x11 config()
function. This is useful for framebuffers on Sun hardware, where we have
multiple truecolor visuals of different depths available, and the root
window typically runs at depth 8, yet there are 24 bit true color visuals
available as well.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7257 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_x11.c')
-rw-r--r-- | libvo/vo_x11.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libvo/vo_x11.c b/libvo/vo_x11.c index cf349c3a37..92f92c9abc 100644 --- a/libvo/vo_x11.c +++ b/libvo/vo_x11.c @@ -272,7 +272,10 @@ static uint32_t config( uint32_t width,uint32_t height,uint32_t d_width,uint32_t XGetWindowAttributes( mDisplay,mRootWin,&attribs ); depth=attribs.depth; - if ( depth != 8 && depth != 15 && depth != 16 && depth != 24 && depth != 32 ) depth=24; + if ( depth != 15 && depth != 16 && depth != 24 && depth != 32 ) { + Visual *visual; + depth = vo_find_depth_from_visuals(mDisplay, mScreen, &visual); + } XMatchVisualInfo( mDisplay,mScreen,depth,TrueColor,&vinfo ); /* set image size (which is indeed neither the input nor output size), |