[Mplayer-cvslog] CVS: main/libvo vo_x11.c,1.129,1.130

Alex Beregszaszi alex at mplayerhq.hu
Fri May 23 23:20:40 CEST 2003


Update of /cvsroot/mplayer/main/libvo
In directory mail:/var/tmp.root/cvs-serv4848

Modified Files:
	vo_x11.c 
Log Message:
swscaler doesn't recognizes support for BGR1/BGR4 too, and so if forced it crashes, without checking the swsContext

Index: vo_x11.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_x11.c,v
retrieving revision 1.129
retrieving revision 1.130
diff -u -r1.129 -r1.130
--- vo_x11.c	23 May 2003 20:35:56 -0000	1.129
+++ vo_x11.c	23 May 2003 21:20:12 -0000	1.130
@@ -398,6 +398,8 @@
 
   /* always allocate swsContext as size could change between frames */
   swsContext= sws_getContextFromCmdLine(width, height, in_format, width, height, out_format );
+  if (!swsContext)
+    return -1;
 
   //printf( "X11 bpp: %d  color mask:  R:%lX  G:%lX  B:%lX\n",bpp,myximage->red_mask,myximage->green_mask,myximage->blue_mask );
 
@@ -565,7 +567,7 @@
     mp_msg(MSGT_VO,MSGL_DBG2,"vo_x11: query_format was called: %x (%s)\n",format,vo_format_name(format));
     if (IMGFMT_IS_BGR(format))
     {
-	if (IMGFMT_BGR_DEPTH(format) == 8)
+	if (IMGFMT_BGR_DEPTH(format) <= 8)
 	    return 0; // TODO 8bpp not yet fully implemented
 	if (IMGFMT_BGR_DEPTH(format) == vo_depthonscreen)
 	    return 3|VFCAP_OSD|VFCAP_SWSCALE|VFCAP_FLIP|VFCAP_ACCEPT_STRIDE;



More information about the MPlayer-cvslog mailing list