[Mplayer-cvslog] CVS: main/Gui/mplayer mw.c,1.111,1.112

Reimar Döffinger CVS syncmail at mplayerhq.hu
Mon Oct 18 20:26:46 CEST 2004


CVS change done by Reimar Döffinger CVS

Update of /cvsroot/mplayer/main/Gui/mplayer
In directory mail:/var2/tmp/cvs-serv15955/Gui/mplayer

Modified Files:
	mw.c 
Log Message:
Limit Gui redraw rate.


Index: mw.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/mw.c,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -r1.111 -r1.112
--- mw.c	26 Jun 2004 13:26:11 -0000	1.111
+++ mw.c	18 Oct 2004 18:26:44 -0000	1.112
@@ -26,6 +26,7 @@
 #include "../../libmpdemux/stheader.h"
 #include "../../codec-cfg.h"
 
+#define GUI_REDRAW_WAIT 375
 
 #include "play.h"
 #include "widgets.h"
@@ -76,6 +77,7 @@
 extern void exit_player(char* how);
 extern int vcd_track;
 extern int osd_visible;
+static unsigned last_redraw_time = 0;
 
 void mplEventHandling( int msg,float param )
 {
@@ -329,6 +331,15 @@
 
 // --- timer events
    case evRedraw:
+        {
+          unsigned now = GetTimerMS();
+          extern int mplPBFade;
+          if ((now > last_redraw_time) &&
+              (now < last_redraw_time + GUI_REDRAW_WAIT) &&
+              !mplPBFade)
+            break;
+          last_redraw_time = now;
+        }
         mplMainRender=1;
         wsPostRedisplay( &appMPlayer.mainWindow );
 	wsPostRedisplay( &appMPlayer.barWindow );




More information about the MPlayer-cvslog mailing list