mirror of
https://github.com/mpv-player/mpv
synced 2025-03-25 04:38:01 +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:
parent
16c2a6660a
commit
6ec672e3cc
@ -120,14 +120,21 @@ void aspect_fit(int *srcw, int *srch, int fitw, int fith){
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void aspect(int *srcw, int *srch, int zoom){
|
static void get_max_dims(int *w, int *h, int zoom)
|
||||||
int fitw = zoom ? aspdat.scrw : aspdat.prew;
|
{
|
||||||
int fith = zoom ? aspdat.scrh : aspdat.preh;
|
*w = zoom ? aspdat.scrw : aspdat.prew;
|
||||||
|
*h = zoom ? aspdat.scrh : aspdat.preh;
|
||||||
if (zoom && WinID >= 0) zoom = A_WINZOOM;
|
if (zoom && WinID >= 0) zoom = A_WINZOOM;
|
||||||
if (zoom == A_WINZOOM) {
|
if (zoom == A_WINZOOM) {
|
||||||
fitw = vo_dwidth;
|
*w = vo_dwidth;
|
||||||
fith = vo_dheight;
|
*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 ) {
|
if( !zoom && geometry_wh_changed ) {
|
||||||
#ifdef ASPECT_DEBUG
|
#ifdef ASPECT_DEBUG
|
||||||
printf("aspect(0) no aspect forced!\n");
|
printf("aspect(0) no aspect forced!\n");
|
||||||
@ -148,15 +155,17 @@ void panscan_calc( void )
|
|||||||
{
|
{
|
||||||
int fwidth,fheight;
|
int fwidth,fheight;
|
||||||
int vo_panscan_area;
|
int vo_panscan_area;
|
||||||
|
int max_w, max_h;
|
||||||
|
get_max_dims(&max_w, &max_h, A_ZOOM);
|
||||||
|
|
||||||
if (vo_panscanrange > 0) {
|
if (vo_panscanrange > 0) {
|
||||||
aspect(&fwidth,&fheight,A_ZOOM);
|
aspect(&fwidth,&fheight,A_ZOOM);
|
||||||
vo_panscan_area = (aspdat.scrh-fheight);
|
vo_panscan_area = max_h - fheight;
|
||||||
if (!vo_panscan_area)
|
if (!vo_panscan_area)
|
||||||
vo_panscan_area = aspdat.scrw - fwidth;
|
vo_panscan_area = max_w - fwidth;
|
||||||
vo_panscan_area *= vo_panscanrange;
|
vo_panscan_area *= vo_panscanrange;
|
||||||
} else
|
} 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_amount = vo_fs ? vo_panscan : 0;
|
||||||
vo_panscan_x = vo_panscan_area * vo_panscan_amount * aspdat.asp;
|
vo_panscan_x = vo_panscan_area * vo_panscan_amount * aspdat.asp;
|
||||||
|
Loading…
Reference in New Issue
Block a user