diff options
author | atmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-10-03 15:31:51 +0000 |
---|---|---|
committer | atmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-10-03 15:31:51 +0000 |
commit | 4d053a65c0adac026c7673d34ca6410002caf159 (patch) | |
tree | 216229d49b70ab433beda628e81fdd6b7075eb8d /libvo/aspect.c | |
parent | 5a2e880711e69b60d53f2b57909361a88cca8178 (diff) | |
download | mpv-4d053a65c0adac026c7673d34ca6410002caf159.tar.bz2 mpv-4d053a65c0adac026c7673d34ca6410002caf159.tar.xz |
Simplified aspect() for the loss of some functionality to get ansi compatibility.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2056 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/aspect.c')
-rw-r--r-- | libvo/aspect.c | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/libvo/aspect.c b/libvo/aspect.c index b9302614e0..59e0992944 100644 --- a/libvo/aspect.c +++ b/libvo/aspect.c @@ -1,5 +1,4 @@ /* Stuff for correct aspect scaling. */ -#include "aspect.h" float monitor_aspect=4.0/3.0; @@ -7,26 +6,20 @@ float monitor_aspect=4.0/3.0; * resolution, that the scaled image should fit into */ -rect_t aspect(int srcw, int srch, int fitinw, int fitinh){ - rect_t r,z; - r.w=fitinw; - r.x=0; - r.h=(int)(((float)fitinw / (float)srcw * (float)srch) +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) * ((float)fitinh/((float)fitinw/monitor_aspect))); - r.h+=r.h%2; // round - r.y=(fitinh-r.h)/2; - z=r; - //printf("aspect rez x: %d y: %d wh: %dx%d\n",r.x,r.y,r.w,r.h); - if(r.h>fitinh || r.h<srch){ - r.h=fitinh; - r.y=0; - r.w=(int)(((float)fitinh / (float)srch * (float)srcw) + *srch+=*srch%2; // round + //printf("aspect rez wh: %dx%d\n",*srcw,*srch); + if(*srch>fitinh || *srch<srchcp){ + *srch=fitinh; + *srcw=(int)(((float)fitinh / (float)srchcp * (float)srcwcp) * ((float)fitinw/((float)fitinh/(1/monitor_aspect)))); - r.w+=r.w%2; // round - r.x=(fitinw-r.w)/2; + *srcw+=*srcw%2; // round } - if(r.w>fitinw) r=z; - //printf("aspect ret x: %d y: %d wh: %dx%d\n",r.x,r.y,r.w,r.h); - return r; + //printf("aspect ret wh: %dx%d\n",*srcw,*srch); } |