[MPlayer-cvslog] r29558 - trunk/libvo/aspect.c

reimar subversion at mplayerhq.hu
Thu Aug 27 14:38:22 CEST 2009


Author: reimar
Date: Thu Aug 27 14:38:22 2009
New Revision: 29558

Log:
Fix aspect_fit to work correctly when borders need to be added on top and
bottom, previous code accidentally compared against screen dimensions,
resulting in cropping instead of added borders.

Modified:
   trunk/libvo/aspect.c

Modified: trunk/libvo/aspect.c
==============================================================================
--- trunk/libvo/aspect.c	Thu Aug 27 14:35:23 2009	(r29557)
+++ trunk/libvo/aspect.c	Thu Aug 27 14:38:22 2009	(r29558)
@@ -99,11 +99,11 @@ void aspect_fit(int *srcw, int *srch, in
 #ifdef ASPECT_DEBUG
   printf("aspect(2) wh: %dx%d (org: %dx%d)\n",*srcw,*srch,aspdat.prew,aspdat.preh);
 #endif
-  if(*srch>aspdat.scrh || *srch<aspdat.orgh){
+  if(*srch>fith || *srch<aspdat.orgh){
       tmpw = (int)(((float)fith / (float)aspdat.preh * (float)aspdat.prew)
                 * ((float)aspdat.scrw / ((float)aspdat.scrh / (1.0/monitor_aspect))));
     tmpw+= tmpw%2; // round
-    if(tmpw<=aspdat.scrw /*&& tmpw>=aspdat.orgw*/){
+    if(tmpw<=fitw /*&& tmpw>=aspdat.orgw*/){
       *srch = fith;
       *srcw = tmpw;
     }else{


More information about the MPlayer-cvslog mailing list