[xiph-cvs] cvs commit: ices/src input.c

Michael Smith msmith at xiph.org
Sat Aug 3 20:00:34 PDT 2002



msmith      02/08/03 20:00:34

  Modified:    src      input.c
  Log:
  Karl Heyes picked up a bug where we could calculate a negative sleep
  length, which wrapped around (in an unsigned variable), so that we
  slept more or less indefinately. Make the variable signed, so we can
  check for < 0 and not sleep.

Revision  Changes    Path
1.14      +3 -3      ices/src/input.c

Index: input.c
===================================================================
RCS file: /usr/local/cvsroot/ices/src/input.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- input.c	2002/08/03 15:05:39	1.13
+++ input.c	2002/08/04 03:00:34	1.14
@@ -2,7 +2,7 @@
  *  - Main producer control loop. Fetches data from input modules, and controls
  *    submission of these to the instance threads. Timing control happens here.
  *
- * $Id: input.c,v 1.13 2002/08/03 15:05:39 msmith Exp $
+ * $Id: input.c,v 1.14 2002/08/04 03:00:34 msmith Exp $
  * 
  * Copyright (c) 2001 Michael Smith <msmith at labyrinth.net.au>
  *
@@ -81,7 +81,7 @@
 /* This is identical to shout_sync(), really. */
 static void _sleep(timing_control *control)
 {
-	uint64_t sleep;
+	int64_t sleep;
 
         /* no need to sleep if we haven't sent data */
         if (control->senttime == 0) return;
@@ -89,7 +89,7 @@
         sleep = ((double)control->senttime / 1000) - 
                 (timing_get_time() - control->starttime);
 
-	if(sleep > 0) timing_sleep(sleep);
+	if(sleep > 0) timing_sleep((uint64_t)sleep);
 }
 
 static int _calculate_pcm_sleep(ref_buffer *buf, timing_control *control)

<p><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