# HG changeset patch # User arpi # Date 1044383504 0 # Node ID caea8ed36b4856067182895468d9f2c3dcf19044 # Parent d824f1a3c3415d28f811da096b8faacdea1d39b8 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 diff -r d824f1a3c341 -r caea8ed36b48 libvo/vo_x11.c --- a/libvo/vo_x11.c Tue Feb 04 18:22:43 2003 +0000 +++ b/libvo/vo_x11.c Tue Feb 04 18:31:44 2003 +0000 @@ -261,7 +261,8 @@ 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 @@ 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 @@ { if ( vo_window == None ) { - xswa.colormap=theCmap; - xswamask|=CWColormap; vo_window=XCreateWindow( mDisplay,mRootWin, vo_dx,vo_dy, vo_dwidth,vo_dheight,