CVS: main/libvo vo_xv.c,1.98,1.99
Update of /cvsroot/mplayer/main/libvo In directory mail:/var/tmp.root/cvs-serv12365 Modified Files: vo_xv.c Log Message: Allow building vo_xv without SHM support Index: vo_xv.c =================================================================== RCS file: /cvsroot/mplayer/main/libvo/vo_xv.c,v retrieving revision 1.98 retrieving revision 1.99 diff -u -r1.98 -r1.99 --- vo_xv.c 10 Jun 2002 18:40:19 -0000 1.98 +++ vo_xv.c 13 Jun 2002 14:23:03 -0000 1.99 @@ -30,7 +30,6 @@ #include <X11/Xlib.h> #include <X11/Xutil.h> -#include <X11/extensions/XShm.h> #include <errno.h> #include "x11_common.h" @@ -55,9 +54,6 @@ extern int verbose; -/* since it doesn't seem to be defined on some platforms */ -int XShmGetEventBase(Display*); - /* local data */ static unsigned char *ImageData; @@ -80,12 +76,17 @@ static XvImage* xvimage[NUM_BUFFERS]; #include <sys/ipc.h> +#ifdef HAVE_SHM #include <sys/shm.h> #include <X11/extensions/XShm.h> -static int Shmem_Flag; -//static int Quiet_Flag; <-- What is that for ? Albeu. +/* since it doesn't seem to be defined on some platforms */ +int XShmGetEventBase(Display*); + static XShmSegmentInfo Shminfo[NUM_BUFFERS]; +#endif + +//static int Quiet_Flag; <-- What is that for ? Albeu. static int gXErrorFlag; static int CompletionType = -1; @@ -514,8 +515,9 @@ { /* * allocate XvImages. FIXME: no error checking, without - * mit-shm this will bomb... + * mit-shm this will bomb... trzing to fix ::atmos */ +#ifdef HAVE_SHM if ( mLocalDisplay && XShmQueryExtension( mDisplay ) ) Shmem_Flag = 1; else { @@ -536,6 +538,7 @@ shmctl(Shminfo[foo].shmid, IPC_RMID, 0); } else +#endif { xvimage[foo] = XvCreateImage(mDisplay, xv_port, xv_format, 0, image_width, image_height); xvimage[foo]->data = malloc(xvimage[foo]->data_size); @@ -547,12 +550,14 @@ static void deallocate_xvimage(int foo) { +#ifdef HAVE_SHM if ( Shmem_Flag ) { XShmDetach( mDisplay,&Shminfo[foo] ); shmdt( Shminfo[foo].shmaddr ); } else +#endif { free(xvimage[foo]->data); } @@ -585,12 +590,14 @@ } if ( e & VO_EVENT_EXPOSE ) { +#ifdef HAVE_SHM if ( Shmem_Flag ) { XvShmPutImage(mDisplay, xv_port, vo_window, vo_gc, xvimage[current_buf], 0, 0, image_width, image_height, drwX, drwY, 1, 1, False); XvShmPutImage(mDisplay, xv_port, vo_window, vo_gc, xvimage[current_buf], 0, 0, image_width, image_height, drwX,drwY,vo_dwidth,(vo_fs?vo_dheight - 1:vo_dheight), False); } else +#endif { XvPutImage(mDisplay, xv_port, vo_window, vo_gc, xvimage[current_buf], 0, 0, image_width, image_height, drwX, drwY, 1, 1); XvPutImage(mDisplay, xv_port, vo_window, vo_gc, xvimage[current_buf], 0, 0, image_width, image_height, drwX,drwY,vo_dwidth,(vo_fs?vo_dheight - 1:vo_dheight)); @@ -604,6 +611,7 @@ static void flip_page(void) { +#ifdef HAVE_SHM if ( Shmem_Flag ) { XvShmPutImage(mDisplay, xv_port, vo_window, vo_gc, xvimage[current_buf], @@ -612,6 +620,7 @@ False); } else +#endif { XvPutImage(mDisplay, xv_port, vo_window, vo_gc, xvimage[current_buf], 0, 0, image_width, image_height,
participants (1)
-
Atmosfear