From: Miguel F. <mig...@us...> - 2005-09-12 00:47:14
|
Update of /cvsroot/xine/xine-plugin/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24680/xine-plugin/src Modified Files: plugin.c Log Message: try Jason Tackaberry suggestion to fix problem of the growing X event queue with increased CPU load (that is, some events were never dequeued) Index: plugin.c =================================================================== RCS file: /cvsroot/xine/xine-plugin/src/plugin.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- plugin.c 12 Aug 2003 02:11:25 -0000 1.26 +++ plugin.c 12 Sep 2005 00:47:03 -0000 1.27 @@ -35,10 +35,6 @@ #include <errno.h> #include <pthread.h> -#ifndef XShmGetEventBase -extern int XShmGetEventBase(Display *); -#endif - #include <stdio.h> #include <math.h> #include <xine.h> @@ -300,12 +296,17 @@ XEvent event; int got_event; - xine_usec_sleep(20000); - XLockDisplay(this->display); - got_event = XCheckMaskEvent(this->display, INPUT_MOTION, &event); + got_event = XPending(this->display); + if( got_event ) + XNextEvent(this->display, &event); XUnlockDisplay(this->display); - + + if( !got_event ) { + xine_usec_sleep(20000); + continue; + } + if( got_event ) { if(event.xany.window != this->video_window) |