[xiph-cvs] cvs commit: libshout/src mp3.c shout.c

Brendan brendan at xiph.org
Thu Mar 27 16:38:28 PST 2003



brendan     03/03/27 19:38:28

  Modified:    include/shout shout.h
               src      mp3.c shout.c
  Log:
  Add shout_delay, which computes milliseconds until shout_send can be called
  again, but doesn't actually sleep.

Revision  Changes    Path
1.17      +3 -0      libshout/include/shout/shout.h

Index: shout.h
===================================================================
RCS file: /usr/local/cvsroot/libshout/include/shout/shout.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- shout.h	12 Mar 2003 19:46:12 -0000	1.16
+++ shout.h	28 Mar 2003 00:38:28 -0000	1.17
@@ -127,6 +127,9 @@
 /* Puts caller to sleep until it is time to send more data to the server */
 void shout_sync(shout_t *self);
 
+/* Amount of time in ms caller should wait before sending again */
+int shout_delay(shout_t *self);
+  
 /* Sets MP3 metadata.
  * Returns:
  *   SHOUTERR_SUCCESS on success

<p><p>1.9       +1 -0      libshout/src/mp3.c

Index: mp3.c
===================================================================
RCS file: /usr/local/cvsroot/libshout/src/mp3.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- mp3.c	18 Mar 2003 00:21:58 -0000	1.8
+++ mp3.c	28 Mar 2003 00:38:28 -0000	1.9
@@ -1,3 +1,4 @@
+/* -*- c-basic-offset: 8; -*- */
 /* mp3.c: libshout MP3 format handler */
 
 #include <stdio.h>

<p><p>1.36      +13 -0     libshout/src/shout.c

Index: shout.c
===================================================================
RCS file: /usr/local/cvsroot/libshout/src/shout.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- shout.c	14 Mar 2003 23:16:58 -0000	1.35
+++ shout.c	28 Mar 2003 00:38:28 -0000	1.36
@@ -1,3 +1,4 @@
+/* -*- c-basic-offset: 8; -*- */
 /* shout.c: Implementation of public libshout interface shout.h */
 
 #ifdef HAVE_CONFIG_H
@@ -215,6 +216,18 @@
                 timing_sleep((uint64_t)sleep);
 }
 
+int shout_delay(shout_t *self)
+{
+	if (!self)
+		return 0;
+
+	if (self->senttime == 0)
+		return 0;
+
+	/* Is this cast to double needed? */
+	return (double)self->senttime / 1000 - (timing_get_time() - self->starttime);
+}
+  
 shout_metadata_t *shout_metadata_new(void)
 {
         return util_dict_new();

<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