[xiph-commits] r9151 - icecast/branches/kh/icecast/src

karl at motherfish-iii.xiph.org karl at motherfish-iii.xiph.org
Mon Apr 18 06:30:04 PDT 2005


Author: karl
Date: 2005-04-18 06:29:59 -0700 (Mon, 18 Apr 2005)
New Revision: 9151

Modified:
   icecast/branches/kh/icecast/src/cfgfile.c
   icecast/branches/kh/icecast/src/cfgfile.h
   icecast/branches/kh/icecast/src/connection.c
   icecast/branches/kh/icecast/src/format_mp3.c
   icecast/branches/kh/icecast/src/source.c
Log:
add subtype override, small cleanup work


Modified: icecast/branches/kh/icecast/src/cfgfile.c
===================================================================
--- icecast/branches/kh/icecast/src/cfgfile.c	2005-04-17 08:42:54 UTC (rev 9150)
+++ icecast/branches/kh/icecast/src/cfgfile.c	2005-04-18 13:29:59 UTC (rev 9151)
@@ -665,6 +665,9 @@
         } else if (strcmp(node->name, "type") == 0) {
             mount->type = (char *)xmlNodeListGetString(
                     doc, node->xmlChildrenNode, 1);
+        } else if (strcmp(node->name, "subtype") == 0) {
+            mount->subtype = (char *)xmlNodeListGetString(
+                    doc, node->xmlChildrenNode, 1);
         }
     } while ((node = node->next));
 }

Modified: icecast/branches/kh/icecast/src/cfgfile.h
===================================================================
--- icecast/branches/kh/icecast/src/cfgfile.h	2005-04-17 08:42:54 UTC (rev 9150)
+++ icecast/branches/kh/icecast/src/cfgfile.h	2005-04-18 13:29:59 UTC (rev 9151)
@@ -79,6 +79,7 @@
     char *stream_genre;
     char *bitrate;
     char *type;
+    char *subtype;
     int yp_public;
 
     struct _mount_proxy *next;

Modified: icecast/branches/kh/icecast/src/connection.c
===================================================================
--- icecast/branches/kh/icecast/src/connection.c	2005-04-17 08:42:54 UTC (rev 9150)
+++ icecast/branches/kh/icecast/src/connection.c	2005-04-18 13:29:59 UTC (rev 9151)
@@ -481,9 +481,6 @@
             return -1;
         }
 
-        global.sources++;
-        global_unlock();
-
         /* for relays, we don't yet have a client, however we do require one
          * to retrieve the stream from.  This is created here, quite late,
          * because we can't use this client to return an error code/message,
@@ -494,11 +491,15 @@
             source->client = client_create (con, parser);
             if (source->client == NULL)
             {
+                global_unlock();
                 config_release_config();
                 return -1;
             }
         }
 
+        global.sources++;
+        global_unlock();
+
         source_update_settings (config, source);
         config_release_config();
 

Modified: icecast/branches/kh/icecast/src/format_mp3.c
===================================================================
--- icecast/branches/kh/icecast/src/format_mp3.c	2005-04-17 08:42:54 UTC (rev 9150)
+++ icecast/branches/kh/icecast/src/format_mp3.c	2005-04-18 13:29:59 UTC (rev 9151)
@@ -111,7 +111,7 @@
     if (metadata)
     {
         state->inline_metadata_interval = atoi (metadata);
-        if (state->inline_metadata_interval)
+        if (state->inline_metadata_interval > 0)
         {
             state->offset = 0;
             plugin->get_buffer = mp3_get_filter_meta;
@@ -611,12 +611,12 @@
     }
 
     metadata = httpp_getvar(client->parser, "icy-metadata");
-    if (metadata && atoi(metadata) && source_mp3->interval)
+    if (metadata && atoi(metadata))
     {
-        if (source_mp3->interval < 0)
+        if (source_mp3->interval > 0)
+            client_mp3->interval = source_mp3->interval;
+        else
             client_mp3->interval = ICY_METADATA_INTERVAL;
-        else
-            client_mp3->interval = source_mp3->interval;
         bytes = snprintf (ptr, remaining, "icy-metaint:%u\r\n",
                 client_mp3->interval);
         if (bytes > 0)

Modified: icecast/branches/kh/icecast/src/source.c
===================================================================
--- icecast/branches/kh/icecast/src/source.c	2005-04-17 08:42:54 UTC (rev 9150)
+++ icecast/branches/kh/icecast/src/source.c	2005-04-18 13:29:59 UTC (rev 9151)
@@ -261,6 +261,9 @@
     util_dict_free (source->audio_info);
     source->audio_info = NULL;
 
+    free(source->fallback_mount);
+    source->fallback_mount = NULL;
+
     free(source->dumpfilename);
     source->dumpfilename = NULL;
 
@@ -288,9 +291,6 @@
     avl_delete (global.source_tree, source, NULL);
     avl_tree_unlock (global.source_tree);
 
-    free(source->fallback_mount);
-    source->fallback_mount = NULL;
-
     /* make sure all YP entries have gone */
     yp_remove (source->mount);
 
@@ -819,7 +819,6 @@
 }
 
 
-
 void source_main (source_t *source)
 {
     source_init (source);
@@ -1017,6 +1016,9 @@
     if (mountinfo->type)
         stats_event (source->mount, "server_type", mountinfo->type);
 
+    if (mountinfo->subtype)
+        stats_event (source->mount, "subtype", mountinfo->subtype);
+
     if (mountinfo->yp_public)
         source->yp_public = mountinfo->yp_public;
 



More information about the commits mailing list