summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-02-04 18:31:44 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-02-04 18:31:44 +0000
commit127530fe9fa003f01a9d634842d464d46129edbe (patch)
tree5d72081b27d530c92b32d1d2d4a93cd7fedf9a00 /libvo
parent7a35f528d1452786abd111e0e23268dc5feb621c (diff)
downloadmpv-127530fe9fa003f01a9d634842d464d46129edbe.tar.bz2
mpv-127530fe9fa003f01a9d634842d464d46129edbe.tar.xz
The reason why mplayer crashes (in some cases) when using x11
output and -wid (>0) parameter is this: Mplayer by default creates a colormap using DirectColor visual. If the window given to mplayer uses TrueColor visual there will be an error when mplayer sets the colormap for the window. This patch modifies mplayer to use TrueColor visual if the window given to mplayer uses TrueColor. Another solution is to make sure that the window given to mplayer is created using DirectColor visual if it is supported by the display. Jouni Tulkki <jitulkki@cc.hut.fi> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9279 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_x11.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libvo/vo_x11.c b/libvo/vo_x11.c
index 99094491d9..8be96d8531 100644
--- a/libvo/vo_x11.c
+++ b/libvo/vo_x11.c
@@ -261,7 +261,8 @@ static uint32_t config( uint32_t width,uint32_t height,uint32_t d_width,uint32_t
Visual *visual;
depth = vo_find_depth_from_visuals(mDisplay, mScreen, &visual);
}
- if ( !XMatchVisualInfo( mDisplay,mScreen,depth,DirectColor,&vinfo ))
+ if ( !XMatchVisualInfo( mDisplay,mScreen,depth,DirectColor,&vinfo ) ||
+ WinID > 0 && vinfo.visualid != XVisualIDFromVisual(attribs.visual))
XMatchVisualInfo( mDisplay,mScreen,depth,TrueColor,&vinfo );
/* set image size (which is indeed neither the input nor output size),
@@ -298,7 +299,8 @@ static uint32_t config( uint32_t width,uint32_t height,uint32_t d_width,uint32_t
xswa.background_pixel=0;
xswa.border_pixel=0;
- xswamask=CWBackPixel | CWBorderPixel;
+ xswa.colormap=theCmap;
+ xswamask=CWBackPixel | CWBorderPixel | CWColormap;
#ifdef HAVE_XF86VM
if ( vm )
@@ -322,8 +324,6 @@ static uint32_t config( uint32_t width,uint32_t height,uint32_t d_width,uint32_t
{
if ( vo_window == None )
{
- xswa.colormap=theCmap;
- xswamask|=CWColormap;
vo_window=XCreateWindow( mDisplay,mRootWin,
vo_dx,vo_dy,
vo_dwidth,vo_dheight,