From 167f1f10fc0fe60351f9c5661e34e4583c264819 Mon Sep 17 00:00:00 2001 From: nick Date: Sat, 20 Oct 2001 12:53:20 +0000 Subject: [PATCH] Fixed half-image bug and added computing of correct aspect during zooming git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2306 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_vesa.c | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/libvo/vo_vesa.c b/libvo/vo_vesa.c index 150ef358fd..544786c062 100644 --- a/libvo/vo_vesa.c +++ b/libvo/vo_vesa.c @@ -212,16 +212,17 @@ static void __vbeCopyBlockSwap(unsigned long offset,uint8_t *image,unsigned long */ static void __vbeCopyData(uint8_t *image) { - unsigned long i,image_offset,offset; + unsigned long i,j,image_offset,offset,limit; unsigned pixel_size,image_line_size,screen_line_size,x_shift; pixel_size = (video_mode_info.BitsPerPixel+7)/8; screen_line_size = video_mode_info.XResolution*pixel_size; image_line_size = image_width*pixel_size; x_shift = x_offset*pixel_size; - for(i=y_offset;i yres) + { + *image_height = yres; + *image_width = yres * factor; + if(verbose) printf("vo_vesa: Y > X tehrefore *image=%ux%u\n",*image_width,*image_height); + } +} + static char *model2str(unsigned char type) { char *retval; @@ -459,8 +477,11 @@ init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint3 if( format==IMGFMT_YV12 ) { /* software scale */ - image_width = video_mode_info.XResolution; - image_height = video_mode_info.YResolution; + vesa_aspect(width,height, + video_mode_info.XResolution,video_mode_info.YResolution, + &image_width,&image_height); +/* image_width = video_mode_info.XResolution; + image_height = video_mode_info.YResolution; */ scale_xinc=(width << 16) / image_width - 2; /* needed for proper rounding */ scale_yinc=(height << 16) / image_height + 2; SwScale_Init(); @@ -490,6 +511,11 @@ init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint3 win.high= video_mode_info.WinSize*1024; x_offset = (video_mode_info.XResolution - image_width) / 2; y_offset = (video_mode_info.YResolution - image_height) / 2; + if(verbose) + printf("vo_vesa: image: %ux%u screen = %ux%u x_offset = %u y_offset = %u\n" + ,image_width,image_height + ,video_mode_info.XResolution,video_mode_info.YResolution + ,x_offset,y_offset); if((err=vbeSaveState(&init_state)) != VBE_OK) { PRINT_VBE_ERR("vbeSaveState",err);