moo.tinys
2009-Sep-26 06:48 UTC
[Icecast-dev] patch to make media player classic works in stream mode instead of download play mode (shoutcastsource)
when media player classic is usually bundled in vary codec packs which
are widely used by most of the windows user that insode code pack, so
it would be nice if icecast support it instead of just fixing media
player classic. and btw it looks like media player classic is not
maintained anymore, except there is a mpc-hc
the problem is that MPC/MPC-HC is too strict that it require the
server response "ICY" instead of "HTTP/1.0"
Index: src/format.c
==================================================================---
src/format.c (revision 16570)
+++ src/format.c (working copy)
@@ -275,6 +275,8 @@
{
unsigned remaining;
char *ptr;
+ const char *useragent;
+ const char *protocol;
int bytes;
int bitrate_filtered = 0;
avl_node *node;
@@ -284,9 +286,19 @@
ptr = client->refbuf->data;
client->respcode = 200;
- bytes = snprintf (ptr, remaining, "HTTP/1.0 200 OK\r\n"
- "Content-Type: %s\r\n",
source->format->contenttype);
+ useragent = httpp_getvar (client->parser, "user-agent");
+ protocol = "HTTP/1.0";
+ if (useragent)
+ {
+ if (strstr(useragent, "shoutcastsource")) /* checking
"Media
Play Classic" is not necessary */
+ {
+ protocol = "ICY";
+ }
+ }
+ bytes = snprintf (ptr, remaining, "%s 200 OK\r\n"
+ "Content-Type: %s\r\n", protocol,
source->format->contenttype);
+
remaining -= bytes;
ptr += bytes;
can be download via http://www.ladio.me/icecast.patch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: icecast.patch
Type: application/octet-stream
Size: 963 bytes
Desc: not available
Url :
http://lists.xiph.org/pipermail/icecast-dev/attachments/20090926/ddd2f93b/attachment.obj
