diff options
author | michael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-02-15 22:31:10 +0000 |
---|---|---|
committer | michael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-02-15 22:31:10 +0000 |
commit | 0b9a7c54b9e9f07508ff1252ad335f8179743281 (patch) | |
tree | c3f495096907b7fc63de06e0b73d92ae12d091d9 /libvo/vo_x11.c | |
parent | 668ec5553c0e13318839bcdcd65af556d7c84770 (diff) | |
download | mpv-0b9a7c54b9e9f07508ff1252ad335f8179743281.tar.bz2 mpv-0b9a7c54b9e9f07508ff1252ad335f8179743281.tar.xz |
avoid allocating a dummy scaler as debug/info messages will only be printed for the first allocated scaler unless -v -v is used
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4719 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_x11.c')
-rw-r--r-- | libvo/vo_x11.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libvo/vo_x11.c b/libvo/vo_x11.c index 6075fcd5e0..e0fdf16532 100644 --- a/libvo/vo_x11.c +++ b/libvo/vo_x11.c @@ -107,6 +107,8 @@ static uint32_t image_width; 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 @@ static uint32_t config( uint32_t width,uint32_t height,uint32_t d_width,uint32_t #endif in_format=format; + srcW= width; + srcH= height; if( flags&0x03 ) fullscreen = 1; if( flags&0x02 ) vm = 1; @@ -401,8 +405,9 @@ static uint32_t config( uint32_t width,uint32_t height,uint32_t d_width,uint32_t 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 @@ static uint32_t draw_slice( uint8_t *src[],int stride[],int w,int h,int x,int y 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) { |