diff options
author | atmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-10-04 11:42:21 +0000 |
---|---|---|
committer | atmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-10-04 11:42:21 +0000 |
commit | 31af6ae1cd148808b704d0db7a0c3268a3023145 (patch) | |
tree | 39e88f0c0a4c3eedf7d91be7b93e301f5708bc41 /libvo/aspect.c | |
parent | 8859c74a11754a6945debebc28cc9d98e811a523 (diff) | |
download | mpv-31af6ae1cd148808b704d0db7a0c3268a3023145.tar.bz2 mpv-31af6ae1cd148808b704d0db7a0c3268a3023145.tar.xz |
Add debug printfs to aspect(), add aspect() usage to vo_sdl.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2072 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/aspect.c')
-rw-r--r-- | libvo/aspect.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/libvo/aspect.c b/libvo/aspect.c index 447674e752..ee47ff667c 100644 --- a/libvo/aspect.c +++ b/libvo/aspect.c @@ -1,4 +1,9 @@ /* Stuff for correct aspect scaling. */ +#undef ASPECT_DEBUG + +#ifdef ASPECT_DEBUG +#include <stdio.h> +#endif float monitor_aspect=4.0/3.0; @@ -10,17 +15,28 @@ void aspect(int *srcw, int *srch, int fitinw, int fitinh){ int srcwcp, srchcp; srcwcp=*srcw; srchcp=*srch; srcwcp=fitinw; +#ifdef ASPECT_DEBUG + printf("aspect(0) fitin: %dx%d \n",fitinw,fitinh); + printf("aspect(1) wh: %dx%d (org: %dx%d)\n",srcwcp,srchcp,*srcw,*srch); +#endif srchcp=(int)(((float)fitinw / (float)*srcw * (float)*srch) - * ((float)fitinh/((float)fitinw/monitor_aspect))); + * ((float)fitinh / ((float)fitinw / monitor_aspect))); srchcp+=srchcp%2; // round - //printf("aspect rez wh: %dx%d (org: %dx%d)\n",srcwcp,srchcp,*srcw,*srch); +#ifdef ASPECT_DEBUG + 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)))); + * ((float)fitinw / ((float)fitinh / (1/monitor_aspect)))); srcwcp+=srcwcp%2; // round } - //printf("aspect ret wh: %dx%d (org: %dx%d)\n",srcwcp,srchcp,*srcw,*srch); +#ifdef ASPECT_DEBUG + printf("aspect(3) wh: %dx%d (org: %dx%d)\n",srcwcp,srchcp,*srcw,*srch); +#endif *srcw=srcwcp; *srch=srchcp; +#ifdef ASPECT_DEBUG + printf("aspect(4) wh: %dx%d (org: %dx%d)\n",srcwcp,srchcp,*srcw,*srch); +#endif } |