gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog gui/NullGui.cpp


From: Udo Giacomozzi
Subject: [Gnash-commit] gnash ChangeLog gui/NullGui.cpp
Date: Wed, 04 Jul 2007 07:32:52 +0000

CVSROOT:        /cvsroot/gnash
Module name:    gnash
Changes by:     Udo Giacomozzi <udog>   07/07/04 07:32:52

Modified files:
        .              : ChangeLog 
        gui            : NullGui.cpp 

Log message:
        use tu_timer instead of gettimeofday()

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3654&r2=1.3655
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/NullGui.cpp?cvsroot=gnash&r1=1.12&r2=1.13

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/gnash/gnash/ChangeLog,v
retrieving revision 1.3654
retrieving revision 1.3655
diff -u -b -r1.3654 -r1.3655
--- ChangeLog   3 Jul 2007 20:47:44 -0000       1.3654
+++ ChangeLog   4 Jul 2007 07:32:51 -0000       1.3655
@@ -1,3 +1,7 @@
+2007-07-04 Udo Giacomozzi <address@hidden>
+
+       * gui/NullGui.cpp: use tu_timer instead of gettimeofday()
+
 2007-07-03 Sandro Santilli <address@hidden>
 
        * configure.ac: disable debugger by default. Use --enable-debugger

Index: gui/NullGui.cpp
===================================================================
RCS file: /cvsroot/gnash/gnash/gui/NullGui.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- gui/NullGui.cpp     3 Jul 2007 15:41:26 -0000       1.12
+++ gui/NullGui.cpp     4 Jul 2007 07:32:52 -0000       1.13
@@ -32,9 +32,7 @@
 # include <unistd.h> // for usleep
 #endif
 
-#include <sys/time.h> // for gettimeofday
-#include <time.h> // for gettimeofday
-#include <errno.h> // for reporting gettimeofday errors
+#include "tu_timer.h"
 
 namespace gnash
 {
@@ -42,35 +40,22 @@
 bool
 NullGui::run()
 {
-  struct timeval tv;
-  unsigned long prevtimer=0;
-
-  if (gettimeofday(&tv, NULL))
-  {
-    cerr << "Could not get time of day: " << strerror(errno) << endl;
-    return false;
-  }
-  unsigned long int start_timer = tv.tv_sec*1000 + tv.tv_usec / 1000;
+  uint64_t prevtimer=0;
+  uint64_t start_timer = tu_timer::get_ticks();  // returns milliseconds
   
   prevtimer = start_timer;
 
   while (true)
   {
   
-    unsigned long int timer=0;
+    uint64_t timer=0;
 
+    // synchronize to frame time 
+    if (_timeout || (_interval>1))  // avoid timing completely for interval==1
     while (1) 
     {
         
-      if (gettimeofday(&tv, NULL))
-      {
-        cerr << "Could not get time of day: " << strerror(errno) << endl;
-        return false;
-      }
-      timer = tv.tv_sec*1000 + tv.tv_usec / 1000;
-            
-      if (_interval==1)
-        break; // special exception for 1 ms interval (run as fast as possible)
+      timer = tu_timer::get_ticks();
 
       if (timer - prevtimer >= _interval)
         break; // next frame, please!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]