# HG changeset patch # User michael # Date 1013812270 0 # Node ID c70b0c4b85f5961ec4152006fe51f328cbab51ac # Parent b7054dadd2c0df2b2d3b7f32339801f294b1f33c avoid allocating a dummy scaler as debug/info messages will only be printed for the first allocated scaler unless -v -v is used diff -r b7054dadd2c0 -r c70b0c4b85f5 libvo/vo_x11.c --- a/libvo/vo_x11.c Fri Feb 15 16:48:25 2002 +0000 +++ b/libvo/vo_x11.c Fri Feb 15 22:31:10 2002 +0000 @@ -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) {