Mercurial > mplayer.hg
changeset 22459:d870e862d272
Simplify config by using code available in video_out.c
author | reimar |
---|---|
date | Tue, 06 Mar 2007 11:34:06 +0000 |
parents | 2c1ecca1886c |
children | fa2b5e300c5a |
files | libvo/vo_directx.c |
diffstat | 1 files changed, 11 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- 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,"<vo_directx><INFO>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