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
This commit is contained in:
arpi 2003-02-04 18:31:44 +00:00
parent 7a35f528d1
commit 127530fe9f
1 changed files with 4 additions and 4 deletions

View File

@ -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,