From dfc9e5e7d33fa46851382916d68d774b9efd9a49 Mon Sep 17 00:00:00 2001 From: atmos4 Date: Wed, 3 Oct 2001 17:40:56 +0000 Subject: Fix case where srch, srcw and fitinw and fitinh are really the same variables. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2059 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/aspect.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'libvo/aspect.c') diff --git a/libvo/aspect.c b/libvo/aspect.c index 59e0992944..447674e752 100644 --- a/libvo/aspect.c +++ b/libvo/aspect.c @@ -9,17 +9,18 @@ float monitor_aspect=4.0/3.0; void aspect(int *srcw, int *srch, int fitinw, int fitinh){ int srcwcp, srchcp; srcwcp=*srcw; srchcp=*srch; - *srcw=fitinw; - *srch=(int)(((float)fitinw / (float)srcwcp * (float)srchcp) + srcwcp=fitinw; + srchcp=(int)(((float)fitinw / (float)*srcw * (float)*srch) * ((float)fitinh/((float)fitinw/monitor_aspect))); - *srch+=*srch%2; // round - //printf("aspect rez wh: %dx%d\n",*srcw,*srch); - if(*srch>fitinh || *srchfitinh || srchcp<*srch){ + srchcp=fitinh; + srcwcp=(int)(((float)fitinh / (float)*srch * (float)*srcw) * ((float)fitinw/((float)fitinh/(1/monitor_aspect)))); - *srcw+=*srcw%2; // round + srcwcp+=srcwcp%2; // round } - //printf("aspect ret wh: %dx%d\n",*srcw,*srch); + //printf("aspect ret wh: %dx%d (org: %dx%d)\n",srcwcp,srchcp,*srcw,*srch); + *srcw=srcwcp; *srch=srchcp; } -- cgit v1.2.3