[MPlayer-dev-eng] better patch for -vo x11 -wid bug

Arpi arpi at thot.banki.hu
Sun Feb 2 02:46:29 CET 2003


Hi,

is this patch supposed to replace your previous patch (aplpying colormap
only for wid<0 case) or apply this over that?

i've commited your previous 'hotfix' patch a week ago...

> 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.
> 
> Note that when using root window the colormap is not set, this is why
> the bug doesn't appear when using -wid 0. To test the bug, first create
> xterm window.
> Then use xwininfo to check the id of the window, and also the visual class.
> Then
> run mplayer using the window id as a parameter. Don't expect to see any
> video
> when using xterm window, this method is only used to test if mplayer crashes
> or not.
> 
> --- vo_x11.c.original   2003-01-26 16:37:57.000000000 +0200
> +++ vo_x11.c    2003-01-29 12:10:28.000000000 +0200
> @@ -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),
> 
> 
> 
> 
> 
> 
> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> http://mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
> 
> 


A'rpi / Astral & ESP-team

--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu
    "However, many people beg for its inclusion in Debian. Why?" - Gabucino
  "Because having new software in Debian is good." - Josselin Mouette
"Because having good software in Debian is new." - Gabucino


More information about the MPlayer-dev-eng mailing list