[xiph-cvs] cvs commit: timing timing.c

Jack Moffitt jack at xiph.org
Sun Dec 9 00:31:22 PST 2001



jack        01/12/09 00:31:21

  Modified:    .        timing.c
  Log:
  Ciaran found this bug.  We only ever set tv_usec, but for bitrates around
  32 and lower, this will set tv_usec to > 1 second, which wrong.  So we
  do it the right way, and put seconds in tv_sec.

Revision  Changes    Path
1.5       +2 -2      timing/timing.c

Index: timing.c
===================================================================
RCS file: /usr/local/cvsroot/timing/timing.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- timing.c	2001/10/20 21:28:09	1.4
+++ timing.c	2001/12/09 08:31:20	1.5
@@ -36,8 +36,8 @@
 {
         struct timeval sleeper;
 
-	sleeper.tv_sec = 0;
-	sleeper.tv_usec = sleeptime * 1000;
+	sleeper.tv_sec = sleeptime / 1000;
+	sleeper.tv_usec = (sleeptime % 1000) * 1000;
 
         /* NOTE:
          * This should be 0 for the first argument.  The linux manpage

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