[xiph-commits] r12480 - trunk/sushivision
xiphmont at svn.xiph.org
xiphmont at svn.xiph.org
Fri Feb 16 00:21:24 PST 2007
Author: xiphmont
Date: 2007-02-16 00:21:23 -0800 (Fri, 16 Feb 2007)
New Revision: 12480
Modified:
trunk/sushivision/spinner.c
trunk/sushivision/spinner.h
Log:
Correct a spinner timer bug that kept it from working on 32 bit (time_t is *not* an int)
Modified: trunk/sushivision/spinner.c
===================================================================
--- trunk/sushivision/spinner.c 2007-02-16 01:51:36 UTC (rev 12479)
+++ trunk/sushivision/spinner.c 2007-02-16 08:21:23 UTC (rev 12480)
@@ -227,19 +227,23 @@
void spinner_set_busy(Spinner *p){
struct timeval now;
- long test;
+ int test;
if(!p)return;
+
+ gettimeofday(&now,NULL);
if(!p->busy){
p->busy=1;
+ p->begin_s = now.tv_sec;
spinner_expose(GTK_WIDGET(p),NULL); // do it now
}else{
- gettimeofday(&now,NULL);
- test = now.tv_sec*1000 + now.tv_usec/1000;
+ test = (now.tv_sec - p->begin_s)*1000 + now.tv_usec/1000;
if(p->last_busy_throttle + 100 < test) {
+
p->busy_count++;
+
if(p->busy_count>7)
p->busy_count=0;
p->last_busy_throttle = test;
Modified: trunk/sushivision/spinner.h
===================================================================
--- trunk/sushivision/spinner.h 2007-02-16 01:51:36 UTC (rev 12479)
+++ trunk/sushivision/spinner.h 2007-02-16 08:21:23 UTC (rev 12480)
@@ -44,7 +44,8 @@
int busy;
int busy_count;
- time_t last_busy_throttle;
+ int last_busy_throttle;
+ time_t begin_s;
};
struct _SpinnerClass{
More information about the commits
mailing list