gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash/gui gui.cpp


From: Udo Giacomozzi
Subject: [Gnash-commit] gnash/gui gui.cpp
Date: Tue, 03 Jul 2007 15:53:39 +0000

CVSROOT:        /cvsroot/gnash
Module name:    gnash
Changes by:     Udo Giacomozzi <udog>   07/07/03 15:53:39

Modified files:
        gui            : gui.cpp 

Log message:
        protection against time glitches (sorry Sandro for the big value, but 
in this case it's appropriate)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gui.cpp?cvsroot=gnash&r1=1.88&r2=1.89

Patches:
Index: gui.cpp
===================================================================
RCS file: /cvsroot/gnash/gnash/gui/gui.cpp,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -b -r1.88 -r1.89
--- gui.cpp     3 Jul 2007 08:43:29 -0000       1.88
+++ gui.cpp     3 Jul 2007 15:53:39 -0000       1.89
@@ -604,6 +604,19 @@
     
     float rate = fps_counter/secs; 
      
+    if (secs > 10000000) {
+      // the timers are unsigned, so when the clock runs "backwards" it leads
+      // to a very high difference value. In theory, this should never happen
+      // with ticks, but it does on my machine (which may have a hw problem?).
+      printf("Time glich detected, need to restart FPS counters, sorry...\n");
+      
+      fps_timer = current_timer;
+      fps_start_timer = current_timer;
+      fps_counter_total = 0;
+      fps_counter = 0;
+      return;
+    } 
+     
     // first FPS message?
     if (fps_timer == fps_start_timer) {     // they're ints, so we can compare
       fps_rate_min = rate;




reply via email to

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