[xiph-commits] r18543 - icecast/trunk/icecast/src

ph3-der-loewe at svn.xiph.org ph3-der-loewe at svn.xiph.org
Sat Aug 18 13:34:12 PDT 2012


Author: ph3-der-loewe
Date: 2012-08-18 13:34:11 -0700 (Sat, 18 Aug 2012)
New Revision: 18543

Modified:
   icecast/trunk/icecast/src/format.c
Log:
allow <stream-name> to override the icy-name: HTTP header, close #1359

Modified: icecast/trunk/icecast/src/format.c
===================================================================
--- icecast/trunk/icecast/src/format.c	2012-08-18 07:17:43 UTC (rev 18542)
+++ icecast/trunk/icecast/src/format.c	2012-08-18 20:34:11 UTC (rev 18543)
@@ -333,7 +333,22 @@
             if (strcasecmp(var->name, "ice-password") &&
                 strcasecmp(var->name, "icy-metaint"))
             {
-                if (!strncasecmp("ice-", var->name, 4))
+		if (!strcasecmp(var->name, "ice-name"))
+		{
+		    ice_config_t *config;
+		    mount_proxy *mountinfo;
+
+		    config = config_get_config();
+		    mountinfo = config_find_mount (config, source->mount);
+
+		    if (mountinfo && mountinfo->stream_name)
+		        bytes = snprintf (ptr, remaining, "icy-name:%s\r\n", mountinfo->stream_name);
+                    else
+		        bytes = snprintf (ptr, remaining, "icy-name:%s\r\n", var->value);
+
+                    config_release_config();
+		}
+                else if (!strncasecmp("ice-", var->name, 4))
                 {
                     if (!strcasecmp("ice-public", var->name))
                         bytes = snprintf (ptr, remaining, "icy-pub:%s\r\n", var->value);



More information about the commits mailing list