diff --git a/Makefile.am b/Makefile.am index 5653a5d9..30b1dc9d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,7 +6,7 @@ ACLOCAL_AMFLAGS = -I m4 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 diff --git a/doc/icecast2_config_file.html b/doc/icecast2_config_file.html index 733da1c8..ac9bca59 100755 --- a/doc/icecast2_config_file.html +++ b/doc/icecast2_config_file.html @@ -428,6 +428,13 @@ to a local relay instead This optional setting allows for providing a burst size which overrides the default burst size as defined in limits. The value is in bytes. +

mp3-metadata-interval

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

hidden

Enable this to prevent this mount from being shown on the xsl pages. This is mainly diff --git a/src/cfgfile.c b/src/cfgfile.c index 2b994eef..a35e9caf 100644 --- a/src/cfgfile.c +++ b/src/cfgfile.c @@ -589,6 +589,11 @@ static void _parse_mount(xmlDocPtr doc, xmlNodePtr node, 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 @@ static void _parse_mount(xmlDocPtr doc, xmlNodePtr node, 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 @@ static void _add_server(xmlDocPtr doc, xmlNodePtr node, } +/* 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; diff --git a/src/connection.c b/src/connection.c index 15d74519..4d55ef32 100644 --- a/src/connection.c +++ b/src/connection.c @@ -640,17 +640,14 @@ int connection_check_source_pass(http_parser_t *parser, const char *mount) 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) { diff --git a/src/format_mp3.c b/src/format_mp3.c index 29de19d7..ec198269 100644 --- a/src/format_mp3.c +++ b/src/format_mp3.c @@ -198,7 +198,7 @@ static void format_mp3_apply_settings (client_t *client, format_plugin_t *format { 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; diff --git a/src/source.c b/src/source.c index c53ad98e..c5275857 100644 --- a/src/source.c +++ b/src/source.c @@ -152,15 +152,8 @@ source_t *source_find_mount (const char *mount) 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 @@ source_t *source_find_mount (const char *mount) 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++; }