[Mplayer-cvslog] CVS: main/libvo aspect.c,1.4,1.5

Atmosfear atmos4 at mplayer.dev.hu
Mon Oct 15 19:22:43 CEST 2001


Update of /cvsroot/mplayer/main/libvo
In directory mplayer:/var/tmp.root/cvs-serv10618/libvo

Modified Files:
	aspect.c 
Log Message:
Add downscaling as a last resort.


Index: aspect.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/aspect.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- aspect.c	4 Oct 2001 11:42:21 -0000	1.4
+++ aspect.c	15 Oct 2001 17:22:41 -0000	1.5
@@ -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 @@
  */
 
 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 @@
   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);




More information about the MPlayer-cvslog mailing list