# HG changeset patch # User reimar # Date 1173180846 0 # Node ID d870e862d2720e35a7ccc45dc912e4e9f39882bc # Parent 2c1ecca1886c81193557ed2034a7f9545c0782d6 Simplify config by using code available in video_out.c diff -r 2c1ecca1886c -r d870e862d272 libvo/vo_directx.c --- a/libvo/vo_directx.c Tue Mar 06 11:24:08 2007 +0000 +++ b/libvo/vo_directx.c Tue Mar 06 11:34:06 2007 +0000 @@ -1271,8 +1271,6 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t options, char *title, uint32_t format) { RECT rd; - vo_screenwidth = monitor_rect.right - monitor_rect.left; - vo_screenheight = monitor_rect.bottom - monitor_rect.top; vo_fs = options & 0x01; image_format = format; image_width = width; @@ -1280,22 +1278,10 @@ d_image_width = d_width; d_image_height = d_height; if(format != primary_image_format)nooverlay = 0; - aspect_save_orig(image_width,image_height); - aspect_save_prescale(d_image_width,d_image_height); - if(vidmode){ - vo_screenwidth=vm_width; - vo_screenheight=vm_height; - } - aspect_save_screenres(vo_screenwidth,vo_screenheight); - aspect(&d_image_width, &d_image_height, A_NOZOOM); window_aspect= (float)d_image_width / (float)d_image_height; - vo_dx = 0; - vo_dy = 0; #ifdef HAVE_NEW_GUI if(use_gui){ - vo_dwidth = d_image_width; - vo_dheight = d_image_height; guiGetEvent(guiSetShVideo, 0); } #endif @@ -1314,11 +1300,7 @@ mp_msg(MSGT_VO, MSGL_DBG3,"overlay surfaces released\n"); if(!vidmode){ - if(vo_geometry){ - vo_dx= ( vo_screenwidth - d_image_width ) / 2; vo_dy=( vo_screenheight - d_image_height ) / 2; - geometry(&vo_dx, &vo_dy, &d_image_width, &d_image_height, vo_screenwidth, vo_screenheight); - } - else { + if(!vo_geometry){ GetWindowRect(hWnd,&rd); vo_dx=rd.left; vo_dy=rd.top; @@ -1584,6 +1566,16 @@ va_end(ap); return color_ctrl_get(data, value); } + case VOCTRL_UPDATE_SCREENINFO: + if (vidmode) { + vo_screenwidth = vm_width; + vo_screenheight = vm_height; + } else { + vo_screenwidth = monitor_rect.right - monitor_rect.left; + vo_screenheight = monitor_rect.bottom - monitor_rect.top; + } + aspect_save_screenres(vo_screenwidth, vo_screenheight); + return VO_TRUE; case VOCTRL_RESET: last_rect.left = 0xDEADC0DE; // reset window position cache // fall-through intended