mirror of
https://github.com/mpv-player/mpv
synced 2025-01-30 19:52:14 +00:00
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:
parent
7a35f528d1
commit
127530fe9f
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user