[xiph-commits] r9235 - in icecast/branches/kh/icecast: . doc src

karl at motherfish-iii.xiph.org karl at motherfish-iii.xiph.org
Sat May 7 15:42:44 PDT 2005


Author: karl
Date: 2005-05-07 15:42:39 -0700 (Sat, 07 May 2005)
New Revision: 9235

Modified:
   icecast/branches/kh/icecast/Makefile.am
   icecast/branches/kh/icecast/doc/icecast2_config_file.html
   icecast/branches/kh/icecast/src/cfgfile.c
   icecast/branches/kh/icecast/src/connection.c
   icecast/branches/kh/icecast/src/format_mp3.c
   icecast/branches/kh/icecast/src/source.c
Log:
sync up work. a couple of places where mount list traversal did not use
the search function. small bits from merge work were found


Modified: icecast/branches/kh/icecast/Makefile.am
===================================================================
--- icecast/branches/kh/icecast/Makefile.am	2005-05-07 21:33:30 UTC (rev 9234)
+++ icecast/branches/kh/icecast/Makefile.am	2005-05-07 22:42:39 UTC (rev 9235)
@@ -6,7 +6,7 @@
 SUBDIRS = src conf debian doc web admin win32
 
 EXTRA_DIST = HACKING m4/acx_pthread.m4 m4/ogg.m4 \
-    m4/theora.m4 m4/vorbis.m4 \
+    m4/theora.m4 m4/vorbis.m4 m4/speex.m4\
     m4/xiph_compiler.m4 m4/xiph_curl.m4 m4/xiph_net.m4 \
     m4/xiph_types.m4 m4/xiph_xml2.m4 icecast.spec
 

Modified: icecast/branches/kh/icecast/doc/icecast2_config_file.html
===================================================================
--- icecast/branches/kh/icecast/doc/icecast2_config_file.html	2005-05-07 21:33:30 UTC (rev 9234)
+++ icecast/branches/kh/icecast/doc/icecast2_config_file.html	2005-05-07 22:42:39 UTC (rev 9235)
@@ -428,6 +428,13 @@
 This optional setting allows for providing a burst size which overrides the default burst size
 as defined in limits.  The value is in bytes.
 </div>
+<h4>mp3-metadata-interval</h4>
+<div class="indentedbox">
+This optional setting specifies what interval, in bytes, there is between metadata updates within
+shoutcast compatible streams. This only applies to new listeners connecting on this mountpoint,
+not existing listeners falling back to this mountpoint.  The default is either the hardcoded
+server default or the value passed from a relay.
+</div>
 <h4>hidden</h4>
 <div class="indentedbox">
 Enable this to prevent this mount from being shown on the xsl pages.  This is mainly

Modified: icecast/branches/kh/icecast/src/cfgfile.c
===================================================================
--- icecast/branches/kh/icecast/src/cfgfile.c	2005-05-07 21:33:30 UTC (rev 9234)
+++ icecast/branches/kh/icecast/src/cfgfile.c	2005-05-07 22:42:39 UTC (rev 9235)
@@ -589,6 +589,11 @@
             mount->max_listeners = atoi(tmp);
             if(tmp) xmlFree(tmp);
         }
+        else if (strcmp(node->name, "mp3-metadata-interval") == 0) {
+            tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
+            mount->mp3_meta_interval = atoi(tmp);
+            if(tmp) xmlFree(tmp);
+        }
         else if (strcmp(node->name, "fallback-override") == 0) {
             tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
             mount->fallback_override = atoi(tmp);
@@ -604,11 +609,6 @@
             mount->no_yp = atoi(tmp);
             if(tmp) xmlFree(tmp);
         }
-        else if (strcmp(node->name, "mp3-metadata-interval") == 0) {
-            tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
-            mount->mp3_meta_interval = atoi(tmp);
-            if(tmp) xmlFree(tmp);
-        }
         else if (strcmp(node->name, "hidden") == 0) {
             tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
             mount->hidden = atoi(tmp);
@@ -1027,6 +1027,7 @@
 }
 
 
+/* return the mount details that match the supplied mountpoint */
 mount_proxy *config_find_mount (ice_config_t *config, const char *mount)
 {
     mount_proxy *mountinfo = config->mounts, *global = NULL;

Modified: icecast/branches/kh/icecast/src/connection.c
===================================================================
--- icecast/branches/kh/icecast/src/connection.c	2005-05-07 21:33:30 UTC (rev 9234)
+++ icecast/branches/kh/icecast/src/connection.c	2005-05-07 22:42:39 UTC (rev 9235)
@@ -640,17 +640,14 @@
     int ice_login = config->ice_login;
     char *protocol;
 
-    mount_proxy *mountinfo = config->mounts;
+    mount_proxy *mountinfo = config_find_mount (config, mount);
 
-    while(mountinfo) {
-        if(!strcmp(mountinfo->mountname, mount)) {
-            if(mountinfo->password)
-                pass = mountinfo->password;
-            if(mountinfo->username)
-                user = mountinfo->username;
-            break;
-        }
-        mountinfo = mountinfo->next;
+    if (mountinfo)
+    {
+        if (mountinfo->password)
+            pass = mountinfo->password;
+        if (mountinfo->username)
+            user = mountinfo->username;
     }
 
     if(!pass) {

Modified: icecast/branches/kh/icecast/src/format_mp3.c
===================================================================
--- icecast/branches/kh/icecast/src/format_mp3.c	2005-05-07 21:33:30 UTC (rev 9234)
+++ icecast/branches/kh/icecast/src/format_mp3.c	2005-05-07 22:42:39 UTC (rev 9235)
@@ -198,7 +198,7 @@
 {
     mp3_state *source_mp3 = format->_state;
 
-    if (mount->mp3_meta_interval < 0)
+    if (mount->mp3_meta_interval <= 0)
     {
         char *metadata = httpp_getvar (client->parser, "icy-metaint");
         source_mp3->interval = -1;

Modified: icecast/branches/kh/icecast/src/source.c
===================================================================
--- icecast/branches/kh/icecast/src/source.c	2005-05-07 21:33:30 UTC (rev 9234)
+++ icecast/branches/kh/icecast/src/source.c	2005-05-07 22:42:39 UTC (rev 9235)
@@ -152,15 +152,8 @@
     int depth = 0;
 
     config = config_get_config();
-    while (mount != NULL)
+    while (mount && depth < MAX_FALLBACK_DEPTH)
     {
-        /* limit the number of times through, maybe infinite */
-        if (depth > MAX_FALLBACK_DEPTH)
-        {
-            source = NULL;
-            break;
-        }
-
         source = source_find_mount_raw(mount);
         if (source)
         {
@@ -170,20 +163,15 @@
                 break;
         }
 
-        /* source is not running, meaning that the fallback is not configured
-           within the source, we need to check the mount list */
-        mountinfo = config->mounts;
+        /* we either have a source which is not active (relay) or no source
+         * at all. Check the mounts list for fallback settings
+         */
+        mountinfo = config_find_mount (config, mount);
         source = NULL;
-        while (mountinfo)
-        {
-            if (strcmp (mountinfo->mountname, mount) == 0)
-                break;
-            mountinfo = mountinfo->next;
-        }
-        if (mountinfo)
-            mount = mountinfo->fallback_mount;
-        else
-            mount = NULL;
+
+        if (mountinfo == NULL)
+            break;
+        mount = mountinfo->fallback_mount;
         depth++;
     }
 



More information about the commits mailing list