[Mplayer-cvslog] CVS: main/libvo vo_x11.c,1.67,1.68

Michael Niedermayer michael at mplayer.dev.hu
Fri Feb 15 23:31:20 CET 2002


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

Modified Files:
	vo_x11.c 
Log Message:
avoid allocating a dummy scaler as debug/info messages will only be printed for the first allocated scaler unless -v -v is used


Index: vo_x11.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_x11.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -r1.67 -r1.68
--- vo_x11.c	14 Feb 2002 16:17:18 -0000	1.67
+++ vo_x11.c	15 Feb 2002 22:31:10 -0000	1.68
@@ -107,6 +107,8 @@
 static uint32_t image_height;
 static uint32_t in_format;
 static uint32_t out_format=0;
+static int srcW=-1;
+static int srcH=-1;
 static int aspect; // 1<<16 based fixed point aspect, so that the aspect stays correct during resizing
 
 static void check_events(){
@@ -261,6 +263,8 @@
 #endif
 
  in_format=format;
+ srcW= width;
+ srcH= height;
  
  if( flags&0x03 ) fullscreen = 1;
  if( flags&0x02 ) vm = 1;
@@ -401,8 +405,9 @@
    	default:  draw_alpha_fnc=draw_alpha_null;
   }
 
-  /* no scaling here, it will be changed during draw_slice if -zoom is on so we dont dupplicate the code */
-  swsContext= getSwsContextFromCmdLine(width, height, in_format, width, height, out_format );
+  /* we avoid unnecessary allocating the swsContext here as it is allocated during draw_slice if zoom is on */
+  if(!zoomFlag)
+	swsContext= getSwsContextFromCmdLine(width, height, in_format, width, height, out_format );
 
 //  printf( "X11 color mask:  R:%lX  G:%lX  B:%lX\n",myximage->red_mask,myximage->green_mask,myximage->blue_mask );
 
@@ -494,7 +499,7 @@
 
     if(sws_flags==0) newW&= (~31); // not needed but, if the user wants the FAST_BILINEAR SCALER, then its needed
 
-    swsContext= getSwsContextFromCmdLine(oldContext->srcW, oldContext->srcH, in_format, 
+    swsContext= getSwsContextFromCmdLine(srcW, srcH, in_format, 
     					 newW, newH, out_format);
     if(swsContext)
     {




More information about the MPlayer-cvslog mailing list