diff options
author | atmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-10-15 17:22:41 +0000 |
---|---|---|
committer | atmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-10-15 17:22:41 +0000 |
commit | 357c10b0a73eac94de929c8b516ae83cd919abba (patch) | |
tree | a16acad1b9c9480c5c95bcb4dabe624c51d35ba8 /libvo | |
parent | 7694b63697eb12bb6d8a6363d34431b5aef38245 (diff) | |
download | mpv-357c10b0a73eac94de929c8b516ae83cd919abba.tar.bz2 mpv-357c10b0a73eac94de929c8b516ae83cd919abba.tar.xz |
Add downscaling as a last resort.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2214 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r-- | libvo/aspect.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/libvo/aspect.c b/libvo/aspect.c index ee47ff667c..42f3d8a340 100644 --- a/libvo/aspect.c +++ b/libvo/aspect.c @@ -1,5 +1,5 @@ /* Stuff for correct aspect scaling. */ -#undef ASPECT_DEBUG +//#define ASPECT_DEBUG #ifdef ASPECT_DEBUG #include <stdio.h> @@ -12,7 +12,7 @@ float monitor_aspect=4.0/3.0; */ void aspect(int *srcw, int *srch, int fitinw, int fitinh){ - int srcwcp, srchcp; + int srcwcp, srchcp, tmp; srcwcp=*srcw; srchcp=*srch; srcwcp=fitinw; #ifdef ASPECT_DEBUG @@ -26,10 +26,13 @@ void aspect(int *srcw, int *srch, int fitinw, int fitinh){ printf("aspect(2) wh: %dx%d (org: %dx%d)\n",srcwcp,srchcp,*srcw,*srch); #endif if(srchcp>fitinh || srchcp<*srch){ - srchcp=fitinh; - srcwcp=(int)(((float)fitinh / (float)*srch * (float)*srcw) - * ((float)fitinw / ((float)fitinh / (1/monitor_aspect)))); - srcwcp+=srcwcp%2; // round + tmp=(int)(((float)fitinh / (float)*srch * (float)*srcw) + * ((float)fitinw / ((float)fitinh / (1/monitor_aspect)))); + if(srcwcp>fitinw){ + srchcp=fitinh; + srcwcp=tmp; + srcwcp+=srcwcp%2; // round + } } #ifdef ASPECT_DEBUG printf("aspect(3) wh: %dx%d (org: %dx%d)\n",srcwcp,srchcp,*srcw,*srch); |