[xiph-commits] r12128 - trunk/sushivision

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Fri Nov 17 08:46:54 PST 2006


Author: xiphmont
Date: 2006-11-17 08:46:52 -0800 (Fri, 17 Nov 2006)
New Revision: 12128

Modified:
   trunk/sushivision/panel-2d.c
   trunk/sushivision/plot.c
   trunk/sushivision/plot.h
Log:
Oops; make the time handling used in line expose compression safe on 32 bit.



Modified: trunk/sushivision/panel-2d.c
===================================================================
--- trunk/sushivision/panel-2d.c	2006-11-17 16:21:27 UTC (rev 12127)
+++ trunk/sushivision/panel-2d.c	2006-11-17 16:46:52 UTC (rev 12128)
@@ -816,6 +816,8 @@
     return 0;
   }
 
+  plot = PLOT(p2->graph);
+
   if(p2->last_line==h){
     p2->last_line++;
     gdk_threads_leave ();
@@ -824,7 +826,6 @@
     return 0;
   }
   
-  plot = PLOT(p2->graph);
   serialno = p2->serialno;
   invh = 1./h;
   d = p->dimensions;

Modified: trunk/sushivision/plot.c
===================================================================
--- trunk/sushivision/plot.c	2006-11-17 16:21:27 UTC (rev 12127)
+++ trunk/sushivision/plot.c	2006-11-17 16:46:52 UTC (rev 12128)
@@ -827,6 +827,12 @@
   p->cross_data = cross_data;
   p->box_callback = box_callback;
   p->box_data = box_data;
+
+  struct timeval now;
+  gettimeofday(&now,NULL);
+
+  p->begin = now.tv_sec;
+  p->last_line_expose = 0;
   return p;
 }
 
@@ -868,17 +874,16 @@
   GtkWidget *widget = GTK_WIDGET(p);
   GdkRectangle r;
   struct timeval now;
-  time_t msec;
+  int64_t msec;
 
   if(num<p->expose_y_lo)
     p->expose_y_lo=num;
   if(num>p->expose_y_hi)
     p->expose_y_hi=num;
   gettimeofday(&now,NULL);
-  msec = now.tv_sec*1000 + now.tv_usec/1000;
+  msec = (now.tv_sec-p->begin)*100LL + now.tv_usec/10000;
 
-  if(msec > p->last_line_expose + 250){
-
+  if(msec > p->last_line_expose + 25){
     r.x=0;
     r.y=p->expose_y_lo;
     r.width=widget->allocation.width;

Modified: trunk/sushivision/plot.h
===================================================================
--- trunk/sushivision/plot.h	2006-11-17 16:21:27 UTC (rev 12127)
+++ trunk/sushivision/plot.h	2006-11-17 16:46:52 UTC (rev 12128)
@@ -78,6 +78,7 @@
   int expose_y_lo;
   int expose_y_hi;
   time_t last_line_expose;
+  time_t begin;
 };
 
 struct _PlotClass{



More information about the commits mailing list