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

Michael Smith msmith at xiph.org
Fri Nov 22 05:01:34 PST 2002



msmith      02/11/22 08:01:34

  Modified:    src      encode.c input.c metadata.c stream.c
  Log:
  Lots more bugfixes from Karl Heyes

Revision  Changes    Path
1.13      +3 -3      ices/src/encode.c

Index: encode.c
===================================================================
RCS file: /usr/local/cvsroot/ices/src/encode.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- encode.c	17 Aug 2002 05:17:57 -0000	1.12
+++ encode.c	22 Nov 2002 13:01:34 -0000	1.13
@@ -1,7 +1,7 @@
 /* encode.c
  * - runtime encoding of PCM data.
  *
- * $Id: encode.c,v 1.12 2002/08/17 05:17:57 msmith Exp $
+ * $Id: encode.c,v 1.13 2002/11/22 13:01:34 msmith Exp $
  *
  * Copyright (c) 2001 Michael Smith <msmith at labyrinth.net.au>
  *
@@ -56,11 +56,11 @@
                                 "maximum %d", channels, rate, min_br, nom_br, max_br);
         } else {
                 if (min_br > 0 || max_br > 0) {
-			LOG_INFO5("Encoder initialising with constrained VBR: %d "
+			LOG_INFO5("Encoder initialising in constrained VBR mode: %d "
                                         "channels, %d Hz, quality %f, minimum bitrate %d, "
                                         "maximum %d", channels, rate, quality, min_br, max_br);
                 } else {
-			LOG_INFO3("Encoder initialising with VBR: %d channel(s), %d Hz, "
+			LOG_INFO3("Encoder initialising in VBR mode: %d channel(s), %d Hz, "
                                         "quality %f", channels, rate, quality);
                 }
         }

<p><p>1.18      +8 -5      ices/src/input.c

Index: input.c
===================================================================
RCS file: /usr/local/cvsroot/ices/src/input.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- input.c	11 Aug 2002 09:45:34 -0000	1.17
+++ input.c	22 Nov 2002 13:01:34 -0000	1.18
@@ -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.17 2002/08/11 09:45:34 msmith Exp $
+ * $Id: input.c,v 1.18 2002/11/22 13:01:34 msmith Exp $
  * 
  * Copyright (c) 2001 Michael Smith <msmith at labyrinth.net.au>
  *
@@ -89,7 +89,13 @@
         sleep = ((double)control->senttime / 1000) - 
                 (timing_get_time() - control->starttime);
 
-	if(sleep > 0) timing_sleep((uint64_t)sleep);
+    if(sleep > 1000) {
+        LOG_WARN1("Extended sleep requested (%ld ms), sleeping for one second",
+                sleep);
+        timing_sleep(1000);
+    }
+    else if(sleep > 0) 
+        timing_sleep((uint64_t)sleep);
 }
 
 static int _calculate_pcm_sleep(ref_buffer *buf, timing_control *control)
@@ -297,10 +303,7 @@
                                 next = instance->next;
 
                                 if (prev)
-				{
                                         prev->next = next;
-					prev = instance;
-				}
                                 else
                                         ices_config->instances = next;
 

<p><p>1.7       +5 -4      ices/src/metadata.c

Index: metadata.c
===================================================================
RCS file: /usr/local/cvsroot/ices/src/metadata.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- metadata.c	20 Jul 2002 12:52:06 -0000	1.6
+++ metadata.c	22 Nov 2002 13:01:34 -0000	1.7
@@ -1,7 +1,7 @@
 /* metadata.c
  * - Metadata manipulation
  *
- * $Id: metadata.c,v 1.6 2002/07/20 12:52:06 msmith Exp $
+ * $Id: metadata.c,v 1.7 2002/11/22 13:01:34 msmith Exp $
  *
  * Copyright (c) 2001 Michael Smith <msmith at labyrinth.net.au>
  *
@@ -83,10 +83,11 @@
         metadata_update_signalled = 0;
 
         file = fopen(ices_config->metadata_filename, "r");
-        LOG_WARN2("Failed to open file %s for metadata update: %s", 
-                ices_config->metadata_filename, strerror(errno));
-        if(!file) 
+        if(!file) {
+            LOG_WARN2("Failed to open file %s for metadata update: %s", 
+                    ices_config->metadata_filename, strerror(errno));
             continue;
+        }
 
                 while(fgets(buf, 1024, file))
                 {

<p><p>1.23      +2 -21     ices/src/stream.c

Index: stream.c
===================================================================
RCS file: /usr/local/cvsroot/ices/src/stream.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- stream.c	17 Aug 2002 05:17:57 -0000	1.22
+++ stream.c	22 Nov 2002 13:01:34 -0000	1.23
@@ -1,7 +1,7 @@
 /* stream.c
  * - Core streaming functions/main loop.
  *
- * $Id: stream.c,v 1.22 2002/08/17 05:17:57 msmith Exp $
+ * $Id: stream.c,v 1.23 2002/11/22 13:01:34 msmith Exp $
  *
  * Copyright (c) 2001 Michael Smith <msmith at labyrinth.net.au>
  *
@@ -23,7 +23,6 @@
 #include "config.h"
 #include "input.h"
 #include "im_playlist.h"
-#include "net/resolver.h"
 #include "signals.h"
 #include "thread/thread.h"
 #include "reencode.h"
@@ -49,7 +48,6 @@
 {
         int ret, shouterr;
         ref_buffer *buffer;
-	char *connip;
         stream_description *sdsc = arg;
         instance_t *stream = sdsc->stream;
         input_module_t *inmod = sdsc->input;
@@ -69,18 +67,8 @@
 
     signal(SIGPIPE, signal_hup_handler);
 
-	connip = malloc(16);
-	if(!resolver_getip(stream->hostname, connip, 16))
-	{
-		LOG_ERROR1("Could not resolve hostname \"%s\"", stream->hostname);
-		free(connip);
-		stream->died = 1;
-		return NULL;
-	}
-
-	if (!(shout_set_host(sdsc->shout, connip)) == SHOUTERR_SUCCESS) {
+	if (!(shout_set_host(sdsc->shout, stream->hostname)) == SHOUTERR_SUCCESS) {
                 LOG_ERROR1("libshout error: %s\n", shout_get_error(sdsc->shout));
-		free(connip);
                 stream->died = 1;
                 return NULL;
         }
@@ -88,7 +76,6 @@
         shout_set_port(sdsc->shout, stream->port);
         if (!(shout_set_password(sdsc->shout, stream->password)) == SHOUTERR_SUCCESS) {
                 LOG_ERROR1("libshout error: %s\n", shout_get_error(sdsc->shout));
-		free(connip);
                 stream->died = 1;
                 return NULL;
         }
@@ -99,21 +86,18 @@
 
     if(shout_set_user(sdsc->shout, user) != SHOUTERR_SUCCESS) {
                 LOG_ERROR1("libshout error: %s\n", shout_get_error(sdsc->shout));
-		free(connip);
                 stream->died = 1;
                 return NULL;
     }
 
         if (!(shout_set_agent(sdsc->shout, VERSIONSTRING)) == SHOUTERR_SUCCESS) {
                 LOG_ERROR1("libshout error: %s\n", shout_get_error(sdsc->shout));
-		free(connip);
                 stream->died = 1;
                 return NULL;
         }
 
         if (!(shout_set_mount(sdsc->shout, stream->mount)) == SHOUTERR_SUCCESS) {
                 LOG_ERROR1("libshout error: %s\n", shout_get_error(sdsc->shout));
-		free(connip);
                 stream->died = 1;
                 return NULL;
         }
@@ -137,21 +121,18 @@
     if(stream_name)
                 if (!(shout_set_name(sdsc->shout, stream_name)) == SHOUTERR_SUCCESS) {
                         LOG_ERROR1("libshout error: %s\n", shout_get_error(sdsc->shout));
-			free(connip);
                         stream->died = 1;
                         return NULL;
                 }
         if (stream_genre)
                 if (!(shout_set_genre(sdsc->shout, stream_genre)) == SHOUTERR_SUCCESS) {
                         LOG_ERROR1("libshout error: %s\n", shout_get_error(sdsc->shout));
-			free(connip);
                         stream->died = 1;
                         return NULL;
                 }
         if (stream_description)
                 if (!(shout_set_description(sdsc->shout, stream_description)) == SHOUTERR_SUCCESS) {
                         LOG_ERROR1("libshout error: %s\n", shout_get_error(sdsc->shout));
-			free(connip);
                         stream->died = 1;
                         return NULL;
                 }

<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