comparison libvo/vo_x11.c @ 4718:c70b0c4b85f5

avoid allocating a dummy scaler as debug/info messages will only be printed for the first allocated scaler unless -v -v is used
author michael
date Fri, 15 Feb 2002 22:31:10 +0000
parents b4f72d6b2365
children 9ff121145b20
comparison
equal deleted inserted replaced
4717:b7054dadd2c0 4718:c70b0c4b85f5
105 105
106 static uint32_t image_width; 106 static uint32_t image_width;
107 static uint32_t image_height; 107 static uint32_t image_height;
108 static uint32_t in_format; 108 static uint32_t in_format;
109 static uint32_t out_format=0; 109 static uint32_t out_format=0;
110 static int srcW=-1;
111 static int srcH=-1;
110 static int aspect; // 1<<16 based fixed point aspect, so that the aspect stays correct during resizing 112 static int aspect; // 1<<16 based fixed point aspect, so that the aspect stays correct during resizing
111 113
112 static void check_events(){ 114 static void check_events(){
113 vo_x11_check_events(mDisplay); 115 vo_x11_check_events(mDisplay);
114 } 116 }
259 static uint32_t vm_width; 261 static uint32_t vm_width;
260 static uint32_t vm_height; 262 static uint32_t vm_height;
261 #endif 263 #endif
262 264
263 in_format=format; 265 in_format=format;
266 srcW= width;
267 srcH= height;
264 268
265 if( flags&0x03 ) fullscreen = 1; 269 if( flags&0x03 ) fullscreen = 1;
266 if( flags&0x02 ) vm = 1; 270 if( flags&0x02 ) vm = 1;
267 if( flags&0x08 ) Flip_Flag = 1; 271 if( flags&0x08 ) Flip_Flag = 1;
268 zoomFlag = flags&0x04; 272 zoomFlag = flags&0x04;
399 out_format= IMGFMT_BGR16; 403 out_format= IMGFMT_BGR16;
400 }break; 404 }break;
401 default: draw_alpha_fnc=draw_alpha_null; 405 default: draw_alpha_fnc=draw_alpha_null;
402 } 406 }
403 407
404 /* no scaling here, it will be changed during draw_slice if -zoom is on so we dont dupplicate the code */ 408 /* we avoid unnecessary allocating the swsContext here as it is allocated during draw_slice if zoom is on */
405 swsContext= getSwsContextFromCmdLine(width, height, in_format, width, height, out_format ); 409 if(!zoomFlag)
410 swsContext= getSwsContextFromCmdLine(width, height, in_format, width, height, out_format );
406 411
407 // printf( "X11 color mask: R:%lX G:%lX B:%lX\n",myximage->red_mask,myximage->green_mask,myximage->blue_mask ); 412 // printf( "X11 color mask: R:%lX G:%lX B:%lX\n",myximage->red_mask,myximage->green_mask,myximage->blue_mask );
408 413
409 // If we have blue in the lowest bit then obviously RGB 414 // If we have blue in the lowest bit then obviously RGB
410 mode=( ( myximage->blue_mask & 0x01 ) != 0 ) ? MODE_RGB : MODE_BGR; 415 mode=( ( myximage->blue_mask & 0x01 ) != 0 ) ? MODE_RGB : MODE_BGR;
492 old_vo_dwidth= vo_dwidth; 497 old_vo_dwidth= vo_dwidth;
493 old_vo_dheight= vo_dheight; 498 old_vo_dheight= vo_dheight;
494 499
495 if(sws_flags==0) newW&= (~31); // not needed but, if the user wants the FAST_BILINEAR SCALER, then its needed 500 if(sws_flags==0) newW&= (~31); // not needed but, if the user wants the FAST_BILINEAR SCALER, then its needed
496 501
497 swsContext= getSwsContextFromCmdLine(oldContext->srcW, oldContext->srcH, in_format, 502 swsContext= getSwsContextFromCmdLine(srcW, srcH, in_format,
498 newW, newH, out_format); 503 newW, newH, out_format);
499 if(swsContext) 504 if(swsContext)
500 { 505 {
501 image_width= (newW+7)&(~7); 506 image_width= (newW+7)&(~7);
502 image_height= newH; 507 image_height= newH;