# HG changeset patch # User atmos4 # Date 1002130856 0 # Node ID b840d091338333390b8c8cdd233f45948a3082e7 # Parent 378aed6b232d9d59ed10d69b1911307ff567e0aa Fix case where srch, srcw and fitinw and fitinh are really the same variables. diff -r 378aed6b232d -r b840d0913383 libvo/aspect.c --- a/libvo/aspect.c Wed Oct 03 17:27:13 2001 +0000 +++ b/libvo/aspect.c Wed Oct 03 17:40:56 2001 +0000 @@ -9,17 +9,18 @@ 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; }