# HG changeset patch # User atmos4 # Date 1003166561 0 # Node ID a98d5300f5e973fa4a0ebecd139f5890c22b5aec # Parent f0f681ef92ff1c9a9a756b7a646b4bc5261df2a5 Add downscaling as a last resort. diff -r f0f681ef92ff -r a98d5300f5e9 libvo/aspect.c --- a/libvo/aspect.c Mon Oct 15 16:59:35 2001 +0000 +++ b/libvo/aspect.c Mon Oct 15 17:22:41 2001 +0000 @@ -1,5 +1,5 @@ /* Stuff for correct aspect scaling. */ -#undef ASPECT_DEBUG +//#define ASPECT_DEBUG #ifdef ASPECT_DEBUG #include @@ -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);