[Mplayer-cvslog] CVS: main/Gui/wm ws.c,1.1,1.2

Arpi of Ize arpi at mplayer.dev.hu
Sun Aug 26 01:18:19 CEST 2001


Update of /cvsroot/mplayer/main/Gui/wm
In directory mplayer:/var/tmp.root/cvs-serv23068

Modified Files:
	ws.c 
Log Message:
DGA2 ifdefs, new mainloop/timer stuff

Index: ws.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/wm/ws.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ws.c	25 Aug 2001 21:04:29 -0000	1.1
+++ ws.c	25 Aug 2001 23:18:17 -0000	1.2
@@ -149,20 +149,24 @@
    fprintf( stderr,"[ws] sorry, your system is not supported X shared memory extension.\n" );
    wsUseXShm=0;
   }
-// if ( !XDGAQueryExtension( wsDisplay,&eventbase,&errorbase ) )
+#ifdef HAVE_DGA2
+ if ( !XDGAQueryExtension( wsDisplay,&eventbase,&errorbase ) )
   {
    fprintf( stderr,"[ws] sorry, your system is not supported DGA extension.\n" );
    wsUseDGA=0;
   }
- #ifdef HAVE_XSHAPE
+#else
+   wsUseDGA=0;
+#endif
+#ifdef HAVE_XSHAPE
   if ( !XShapeQueryExtension( wsDisplay,&eventbase,&errorbase ) )
    {
     fprintf( stderr,"[ws] sorry, your system is not supported XShape extension.\n" );
     wsUseXShape=0;
    }
- #else
+#else
   wsUseXShape=0;
- #endif
+#endif
 
  XSynchronize( wsDisplay,True );
 
@@ -172,7 +176,7 @@
  wsMaxY=DisplayHeight( wsDisplay,wsScreen );
 
  wsGetDepthOnScreen();
- #ifdef DEBUG
+#ifdef DEBUG
   {
    int minor,major,shp;
    fprintf( stderr,"[ws] Screen depth: %d\n",wsDepthOnScreen );
@@ -184,11 +188,11 @@
      XShmQueryVersion( wsDisplay,&major,&minor,&shp );
      fprintf( stderr,"[ws] XShm version is %d.%d\n",major,minor );
     }
-   if ( wsUseDGA )
-    {
+//   if ( wsUseDGA )
+//    {
 //     XDGAQueryVersion( wsDisplay,&major,&minor );
 //     fprintf( stderr,"[ws] DGA version is %d.%d\n",major,minor );
-    }
+//    }
    #ifdef HAVE_XSHAPE
     if ( wsUseXShape )
      {
@@ -197,7 +201,7 @@
      }
    #endif
   }
- #endif
+#endif
  initConverter();
  wsOutMask=wsGetOutMask();
  switch ( wsOutMask )
@@ -629,15 +633,36 @@
 
 void wsMainLoop( void )
 {
+ int delay=20;
  fprintf( stderr,"[ws] init threads: %d\n",XInitThreads() );
  XSynchronize( wsDisplay,False );
  XLockDisplay( wsDisplay );
 // XIfEvent( wsDisplay,&wsEvent,wsEvents,NULL );
+
+#if 1
+
+while(wsTrue){
+ // handle pending events
+ while ( XPending(wsDisplay) ){
+   XNextEvent( wsDisplay,&wsEvent );
+   printf("### X event: %d  [%d]\n",wsEvent.type,delay);
+   wsEvents( wsDisplay,&wsEvent,NULL );
+   delay=20;
+ }
+ mplTimerHandler(0); // handle timer event
+ usleep(delay*1000); // FIXME!
+ if(delay<8*20) delay+=20; // pump up delay up to 0.16 sec (low activity)
+}
+
+#else
+
  while( wsTrue )
   {
    XIfEvent( wsDisplay,&wsEvent,wsDummyEvents,NULL );
    wsEvents( wsDisplay,&wsEvent,NULL );
   }
+#endif
+
  XUnlockDisplay( wsDisplay );
 }
 




More information about the MPlayer-cvslog mailing list