[icecast-dev] icecast 2 compatibility with older clients
Brendan Cully
brendan at xiph.org
Wed Jul 2 16:48:10 PDT 2003
On Wednesday, 02 July 2003 at 19:19, Brendan Cully wrote:
> I've attached a small patch against icecast 2 which converts ice-
> headers to icy- headers for clients that include icy- headers in their
> request. This allows a few clients (notably xmms) to pick up stream
> info they otherwise miss.
Per Jack's suggestion, here's a different version that forces icy mode
when the stream is MP3 format.
-------------- next part --------------
Index: src/format.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/format.c,v
retrieving revision 1.20
diff -u -p -r1.20 format.c
--- src/format.c 15 Mar 2003 02:10:17 -0000 1.20
+++ src/format.c 2 Jul 2003 23:45:51 -0000
@@ -1,3 +1,4 @@
+/* -*- c-basic-offset: 4; -*- */
/* format.c
**
** format plugin implementation
@@ -109,8 +110,12 @@ void format_send_general_headers(format_
var = (http_var_t *)node->key;
if (strcasecmp(var->name, "ice-password") &&
(!strncasecmp("ice-", var->name, 4) ||
- !strncasecmp("icy-", var->name, 4))) {
- bytes = sock_write(client->con->sock,
+ !strncasecmp("icy-", var->name, 4))) {
+ if (source->format->type == FORMAT_TYPE_MP3)
+ bytes = sock_write(client->con->sock, "icy%s:%s\r\n",
+ var->name + 3, var->value);
+ else
+ bytes = sock_write(client->con->sock,
"%s: %s\r\n", var->name, var->value);
if(bytes > 0) client->con->sent_bytes += bytes;
}
More information about the Icecast-dev
mailing list