[Mplayer-cvslog] CVS: main/libvo vo_xv.c,1.35,1.36 aspect.c,1.1,1.2 aspect.h,1.1,1.2
Atmosfear
atmos4 at mplayer.dev.hu
Wed Oct 3 17:32:13 CEST 2001
Update of /cvsroot/mplayer/main/libvo
In directory mplayer:/var/tmp.root/cvs-serv7025/libvo
Modified Files:
vo_xv.c aspect.c aspect.h
Log Message:
Simplified aspect() for the loss of some functionality to get ansi compatibility.
Index: vo_xv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xv.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- vo_xv.c 3 Oct 2001 14:53:15 -0000 1.35
+++ vo_xv.c 3 Oct 2001 15:31:50 -0000 1.36
@@ -121,7 +121,6 @@
static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format)
{
// int screen;
-// int myx,myy;
char *hello = (title == NULL) ? "Xv render" : title;
// char *name = ":0.0";
XSizeHints hint;
@@ -169,9 +168,8 @@
*/
{
- rect_t newres = aspect(d_width,d_height,vo_screenwidth,vo_screenheight);
- dwidth=d_width=newres.w; dheight=d_height=newres.h;
- //myx=newres.x; myy=newres.y;
+ aspect(&d_width,&d_height,vo_screenwidth,vo_screenheight);
+ dwidth=d_width; dheight=d_height;
}
#endif
@@ -286,12 +284,12 @@
if ( mFullscreen )
{
- drwX=( vo_screenwidth - (dwidth > vo_screenwidth?vo_screenwidth:dwidth) ) / 2; /* =myx; */
+ drwX=( vo_screenwidth - (dwidth > vo_screenwidth?vo_screenwidth:dwidth) ) / 2;
drwcX+=drwX;
- drwY=( vo_screenheight - (dheight > vo_screenheight?vo_screenheight:dheight) ) / 2; /* =myy; */
+ drwY=( vo_screenheight - (dheight > vo_screenheight?vo_screenheight:dheight) ) / 2;
drwcY+=drwY;
- drwWidth=(dwidth > vo_screenwidth?vo_screenwidth:dwidth); /* =dwidth */
- drwHeight=(dheight > vo_screenheight?vo_screenheight:dheight); /* =dheight */
+ drwWidth=(dwidth > vo_screenwidth?vo_screenwidth:dwidth);
+ drwHeight=(dheight > vo_screenheight?vo_screenheight:dheight);
printf( "[xv-fs] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight );
}
#ifdef HAVE_NEW_GUI
Index: aspect.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/aspect.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- aspect.c 3 Oct 2001 14:41:53 -0000 1.1
+++ aspect.c 3 Oct 2001 15:31:51 -0000 1.2
@@ -1,5 +1,4 @@
/* Stuff for correct aspect scaling. */
-#include "aspect.h"
float monitor_aspect=4.0/3.0;
@@ -7,26 +6,20 @@
* resolution, that the scaled image should fit into
*/
-rect_t aspect(int srcw, int srch, int fitinw, int fitinh){
- rect_t r,z;
- r.w=fitinw;
- r.x=0;
- r.h=(int)(((float)fitinw / (float)srcw * (float)srch)
+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)
* ((float)fitinh/((float)fitinw/monitor_aspect)));
- r.h+=r.h%2; // round
- r.y=(fitinh-r.h)/2;
- z=r;
- //printf("aspect rez x: %d y: %d wh: %dx%d\n",r.x,r.y,r.w,r.h);
- if(r.h>fitinh || r.h<srch){
- r.h=fitinh;
- r.y=0;
- r.w=(int)(((float)fitinh / (float)srch * (float)srcw)
+ *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)
* ((float)fitinw/((float)fitinh/(1/monitor_aspect))));
- r.w+=r.w%2; // round
- r.x=(fitinw-r.w)/2;
+ *srcw+=*srcw%2; // round
}
- if(r.w>fitinw) r=z;
- //printf("aspect ret x: %d y: %d wh: %dx%d\n",r.x,r.y,r.w,r.h);
- return r;
+ //printf("aspect ret wh: %dx%d\n",*srcw,*srch);
}
Index: aspect.h
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/aspect.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- aspect.h 3 Oct 2001 14:41:53 -0000 1.1
+++ aspect.h 3 Oct 2001 15:31:51 -0000 1.2
@@ -2,14 +2,7 @@
#define __ASPECT_H
/* Stuff for correct aspect scaling. */
-typedef struct {
- int x; /* x,y starting coordinate */
- int y; /* of upper left corner */
- int w; /* width */
- int h; /* height */
-} rect_t;
-
-rect_t aspect(int srcw, int srch, int fitinw, int fitinh);
+void aspect(int *srcw, int *srch, int fitinw, int fitinh);
#endif
More information about the MPlayer-cvslog
mailing list