1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-22 03:08:33 +00:00

Make panscan cover the same range in -wid -fs mode as in normal mode.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29560 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2009-08-27 13:31:12 +00:00
parent 16c2a6660a
commit 6ec672e3cc

View File

@ -120,14 +120,21 @@ void aspect_fit(int *srcw, int *srch, int fitw, int fith){
#endif
}
void aspect(int *srcw, int *srch, int zoom){
int fitw = zoom ? aspdat.scrw : aspdat.prew;
int fith = zoom ? aspdat.scrh : aspdat.preh;
static void get_max_dims(int *w, int *h, int zoom)
{
*w = zoom ? aspdat.scrw : aspdat.prew;
*h = zoom ? aspdat.scrh : aspdat.preh;
if (zoom && WinID >= 0) zoom = A_WINZOOM;
if (zoom == A_WINZOOM) {
fitw = vo_dwidth;
fith = vo_dheight;
*w = vo_dwidth;
*h = vo_dheight;
}
}
void aspect(int *srcw, int *srch, int zoom){
int fitw;
int fith;
get_max_dims(&fitw, &fith, zoom);
if( !zoom && geometry_wh_changed ) {
#ifdef ASPECT_DEBUG
printf("aspect(0) no aspect forced!\n");
@ -148,15 +155,17 @@ void panscan_calc( void )
{
int fwidth,fheight;
int vo_panscan_area;
int max_w, max_h;
get_max_dims(&max_w, &max_h, A_ZOOM);
if (vo_panscanrange > 0) {
aspect(&fwidth,&fheight,A_ZOOM);
vo_panscan_area = (aspdat.scrh-fheight);
vo_panscan_area = max_h - fheight;
if (!vo_panscan_area)
vo_panscan_area = aspdat.scrw - fwidth;
vo_panscan_area = max_w - fwidth;
vo_panscan_area *= vo_panscanrange;
} else
vo_panscan_area = -vo_panscanrange * aspdat.scrh;
vo_panscan_area = -vo_panscanrange * max_h;
vo_panscan_amount = vo_fs ? vo_panscan : 0;
vo_panscan_x = vo_panscan_area * vo_panscan_amount * aspdat.asp;