mirror of
https://github.com/mpv-player/mpv
synced 2025-02-02 05:01:56 +00:00
Use standard aspect code
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2690 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
ab6ccafde3
commit
44101a8d68
@ -34,6 +34,7 @@
|
|||||||
#include "sub.h"
|
#include "sub.h"
|
||||||
#include "linux/vbelib.h"
|
#include "linux/vbelib.h"
|
||||||
#include "bswap.h"
|
#include "bswap.h"
|
||||||
|
#include "aspect.h"
|
||||||
|
|
||||||
#include "../postproc/swscale.h"
|
#include "../postproc/swscale.h"
|
||||||
#include "../postproc/rgb2rgb.h"
|
#include "../postproc/rgb2rgb.h"
|
||||||
@ -414,23 +415,6 @@ static uint32_t query_format(uint32_t format)
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vesa_aspect(uint32_t width,uint32_t height,
|
|
||||||
uint32_t xres,uint32_t yres,
|
|
||||||
uint32_t *image_width,uint32_t *image_height)
|
|
||||||
{
|
|
||||||
float aspect_factor;
|
|
||||||
aspect_factor = (float)width / height;
|
|
||||||
*image_width = xres;
|
|
||||||
*image_height = xres /aspect_factor;
|
|
||||||
if(verbose) printf("vo_vesa: aspect factor = %f(%ux%u) *image=%ux%u screen=%ux%u\n",aspect_factor,width,height,*image_width,*image_height,xres,yres);
|
|
||||||
if((*image_height) > yres)
|
|
||||||
{
|
|
||||||
*image_height = yres;
|
|
||||||
*image_width = yres * aspect_factor;
|
|
||||||
if(verbose) printf("vo_vesa: Y > X therefore *image=%ux%u\n",*image_width,*image_height);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void paintBkGnd( void )
|
static void paintBkGnd( void )
|
||||||
{
|
{
|
||||||
int x_res = video_mode_info.XResolution;
|
int x_res = video_mode_info.XResolution;
|
||||||
@ -686,9 +670,12 @@ init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint3
|
|||||||
{
|
{
|
||||||
/* software scale */
|
/* software scale */
|
||||||
if(vesa_zoom > 1)
|
if(vesa_zoom > 1)
|
||||||
vesa_aspect(image_width,image_height,
|
{
|
||||||
video_mode_info.XResolution,video_mode_info.YResolution,
|
aspect_save_orig(width,height);
|
||||||
&image_width,&image_height);
|
aspect_save_prescale(d_width,d_height);
|
||||||
|
aspect_save_screenres(video_mode_info.XResolution,video_mode_info.YResolution);
|
||||||
|
aspect(&image_width,&image_height,A_ZOOM);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
if(fs_mode)
|
if(fs_mode)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user