summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authoratmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-10-03 17:40:56 +0000
committeratmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-10-03 17:40:56 +0000
commitdfc9e5e7d33fa46851382916d68d774b9efd9a49 (patch)
tree06ea603feefe497bbd6edb91fbb2b39a99524bad /libvo
parentee2e0f2bdded371e07aa3999417fc8e7ef866d4a (diff)
downloadmpv-dfc9e5e7d33fa46851382916d68d774b9efd9a49.tar.bz2
mpv-dfc9e5e7d33fa46851382916d68d774b9efd9a49.tar.xz
Fix case where srch, srcw and fitinw and fitinh are really the same variables.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2059 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/aspect.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/libvo/aspect.c b/libvo/aspect.c
index 59e0992944..447674e752 100644
--- a/libvo/aspect.c
+++ b/libvo/aspect.c
@@ -9,17 +9,18 @@ float monitor_aspect=4.0/3.0;
void aspect(int *srcw, int *srch, int fitinw, int fitinh){
int srcwcp, srchcp;
srcwcp=*srcw; srchcp=*srch;
- *srcw=fitinw;
- *srch=(int)(((float)fitinw / (float)srcwcp * (float)srchcp)
+ srcwcp=fitinw;
+ srchcp=(int)(((float)fitinw / (float)*srcw * (float)*srch)
* ((float)fitinh/((float)fitinw/monitor_aspect)));
- *srch+=*srch%2; // round
- //printf("aspect rez wh: %dx%d\n",*srcw,*srch);
- if(*srch>fitinh || *srch<srchcp){
- *srch=fitinh;
- *srcw=(int)(((float)fitinh / (float)srchcp * (float)srcwcp)
+ srchcp+=srchcp%2; // round
+ //printf("aspect rez wh: %dx%d (org: %dx%d)\n",srcwcp,srchcp,*srcw,*srch);
+ if(srchcp>fitinh || srchcp<*srch){
+ srchcp=fitinh;
+ srcwcp=(int)(((float)fitinh / (float)*srch * (float)*srcw)
* ((float)fitinw/((float)fitinh/(1/monitor_aspect))));
- *srcw+=*srcw%2; // round
+ srcwcp+=srcwcp%2; // round
}
- //printf("aspect ret wh: %dx%d\n",*srcw,*srch);
+ //printf("aspect ret wh: %dx%d (org: %dx%d)\n",srcwcp,srchcp,*srcw,*srch);
+ *srcw=srcwcp; *srch=srchcp;
}