changeset 29516:87897065b7d7

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.
author reimar
date Thu, 27 Aug 2009 12:38:22 +0000
parents d3700065005f
children a2617c70b295
files libvo/aspect.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/aspect.c	Thu Aug 27 12:35:23 2009 +0000
+++ b/libvo/aspect.c	Thu Aug 27 12:38:22 2009 +0000
@@ -99,11 +99,11 @@
 #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{