diff options
author | atmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-05-14 00:22:03 +0000 |
---|---|---|
committer | atmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-05-14 00:22:03 +0000 |
commit | 3e85b7e4fbc1e59ea78d5c9394e511b66337adfe (patch) | |
tree | 09fff12e2138023e17b95d19afbc765e0b1d9fa1 /libvo/aspect.c | |
parent | 92afb163d3b58d2ec9126b8c4d3764895e60f5e2 (diff) | |
download | mpv-3e85b7e4fbc1e59ea78d5c9394e511b66337adfe.tar.bz2 mpv-3e85b7e4fbc1e59ea78d5c9394e511b66337adfe.tar.xz |
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
Also add a testapp for the aspect code.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6088 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/aspect.c')
-rw-r--r-- | libvo/aspect.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/libvo/aspect.c b/libvo/aspect.c index bafa2e15fb..463f3bfe09 100644 --- a/libvo/aspect.c +++ b/libvo/aspect.c @@ -1,9 +1,12 @@ /* Stuff for correct aspect scaling. */ #include "aspect.h" +#ifndef ASPECT_TEST +#include "../mp_msg.h" +#endif //#define ASPECT_DEBUG -#ifdef ASPECT_DEBUG +#if defined(ASPECT_DEBUG) || defined(ASPECT_TEST) #include <stdio.h> #endif @@ -64,10 +67,16 @@ void aspect(int *srcw, int *srch, int zoom){ else tmpw = (int)((float)aspdat.prew * ((float)aspdat.scrw / ((float)aspdat.scrh / (1.0/monitor_aspect)))); - if(tmpw<=aspdat.scrw && tmpw>=aspdat.orgw){ + tmpw+= tmpw%2; // round + if(tmpw<=aspdat.scrw /*&& tmpw>=aspdat.orgw*/){ *srch = zoom?aspdat.scrh:aspdat.preh; *srcw = tmpw; - *srcw+= *srcw%2; // round + }else{ +#ifndef ASPECT_TEST + mp_msg(MSGT_VO,MSGL_WARN,"aspect: Warning: no suitable new res found!\n"); +#else + printf("error: no new size found that fits into res!\n"); +#endif } } #ifdef ASPECT_DEBUG |