[xiph-cvs] cvs commit: snatch Snatch

Monty xiphmont at xiph.org
Fri May 10 17:11:00 PDT 2002



xiphmont    02/05/10 17:11:00

  Modified:    .        Snatch
  Log:
  fix yet another idiot timer bug

Revision  Changes    Path
1.11      +15 -10    snatch/Snatch

Index: Snatch
===================================================================
RCS file: /usr/local/cvsroot/snatch/Snatch,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- Snatch	2002/05/10 20:05:17	1.10
+++ Snatch	2002/05/11 00:10:59	1.11
@@ -575,7 +575,8 @@
 }
 
 sub Robot_Active{
-    $next_timer_event=0;
+    $next_timer_start=0;
+    $next_timer_end=0;
     if(defined($timer_callback) && !recording_active){
         $timer_callback->cancel();
         undef $timer_callback;
@@ -596,7 +597,8 @@
 }
 
 sub Robot_Inactive{
-    $next_timer_event=0;
+    $next_timer_start=0;
+    $next_timer_end=0;
     $mode='inactive';
     if(defined($timer_callback)){
         $timer_callback->cancel();
@@ -616,7 +618,8 @@
 }
 
 sub Robot_Timer{
-    $next_timer_event=0;
+    $next_timer_start=0;
+    $next_timer_end=0;
     send_string("O","");
     send_string("L","");
     syswrite COMM_SOCK,'T';
@@ -652,7 +655,8 @@
     my$now=time();
     my at TIMETEMP=@TIMER_TIMES;
     my at ENDTIMETEMP=@TIMER_ENDTIMES;
-    $next_timer_event=0;
+    $next_timer_start=0;
+    $next_timer_end=0;
 
     foreach my$line (@TIMER){
         my$start=shift @TIMETEMP;
@@ -660,12 +664,13 @@
 
         if($start<=$now && $end>$now){    
             Robot_Stop();
-	    $next_timer_event=$now;
+	    $next_timer_start=$start;
+	    $next_timer_end=$end;
             DoTimedEntry($start,$line);
             return;
         }else{
-	    $next_timer_event=$start if(($next_timer_event==0 || 
-					$start<$next_timer_event) && $start>$now);
+	    $next_timer_start=$start if(($next_timer_start==0 || 
+					$start<$next_timer_start) && $start>$now);
         }
     }
     # nothing happening now
@@ -685,10 +690,10 @@
         }else{
             
             my $next;
-	    if($recording_active){
-		$next=$TIMER_ENDTIMES[$TIMER_SORTED[0]];
+	    if($recording_active || $recording_pending){
+		$next=$next_timer_end;
             }else{
-		$next=$next_timer_event;
+		$next=$next_timer_start;
             }
             
             if($now>=$next){

<p><p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list