1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-27 01:22:30 +00:00

Use aspect()

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2055 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
atmos4 2001-10-03 14:53:15 +00:00
parent abb7153e94
commit 5a2e880711

View File

@ -36,6 +36,7 @@ LIBVO_EXTERN(xv)
#include "fastmemcpy.h" #include "fastmemcpy.h"
#include "sub.h" #include "sub.h"
#include "aspect.h"
static vo_info_t vo_info = static vo_info_t vo_info =
{ {
@ -120,6 +121,7 @@ static void draw_alpha_null(int x0,int y0, int w,int h, unsigned char* src, unsi
static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format) static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format)
{ {
// int screen; // int screen;
// int myx,myy;
char *hello = (title == NULL) ? "Xv render" : title; char *hello = (title == NULL) ? "Xv render" : title;
// char *name = ":0.0"; // char *name = ":0.0";
XSizeHints hint; XSizeHints hint;
@ -158,23 +160,19 @@ static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t
{ {
hint.width=vo_screenwidth; hint.width=vo_screenwidth;
hint.height=vo_screenheight; hint.height=vo_screenheight;
#ifdef X11_FULLSCREEN
/* this code replaces X11_FULLSCREEN hack in mplayer.c /* this code replaces X11_FULLSCREEN hack in mplayer.c
* with libvo2 this should be unified among vo plugins * aspect() is available through aspect.h for all vos.
* besides zooming should only be done with -zoom, * besides zooming should only be done with -zoom,
* but I leave the old -fs behaviour so users don't get * but I leave the old -fs behaviour so users don't get
* irritated for now (and send lots o' mails ;) ::atmos * irritated for now (and send lots o' mails ;) ::atmos
*/ */
#ifdef X11_FULLSCREEN {
d_height=(int)((float)vo_screenwidth/(float)dwidth*(float)dheight); rect_t newres = aspect(d_width,d_height,vo_screenwidth,vo_screenheight);
d_height+=d_height%2; // round dwidth=d_width=newres.w; dheight=d_height=newres.h;
d_width=vo_screenwidth; //myx=newres.x; myy=newres.y;
if(dheight>vo_screenheight){
d_width=(int)((float)vo_screenheight/(float)dheight*(float)dwidth);
d_width+=d_width%2; // round
d_height=vo_screenheight;
} }
dwidth=d_width; dheight=d_height;
#endif #endif
} }
@ -288,12 +286,12 @@ static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t
if ( mFullscreen ) if ( mFullscreen )
{ {
drwX=( vo_screenwidth - (dwidth > vo_screenwidth?vo_screenwidth:dwidth) ) / 2; drwX=( vo_screenwidth - (dwidth > vo_screenwidth?vo_screenwidth:dwidth) ) / 2; /* =myx; */
drwcX+=drwX; drwcX+=drwX;
drwY=( vo_screenheight - (dheight > vo_screenheight?vo_screenheight:dheight) ) / 2; drwY=( vo_screenheight - (dheight > vo_screenheight?vo_screenheight:dheight) ) / 2; /* =myy; */
drwcY+=drwY; drwcY+=drwY;
drwWidth=(dwidth > vo_screenwidth?vo_screenwidth:dwidth); drwWidth=(dwidth > vo_screenwidth?vo_screenwidth:dwidth); /* =dwidth */
drwHeight=(dheight > vo_screenheight?vo_screenheight:dheight); drwHeight=(dheight > vo_screenheight?vo_screenheight:dheight); /* =dheight */
printf( "[xv-fs] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight ); printf( "[xv-fs] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight );
} }
#ifdef HAVE_NEW_GUI #ifdef HAVE_NEW_GUI