[xiph-commits] r8178 - icecast/branches/kh/icecast/src

karl at motherfish-iii.xiph.org karl at motherfish-iii.xiph.org
Sat Nov 6 08:18:56 PST 2004


Author: karl
Date: 2004-11-06 08:18:55 -0800 (Sat, 06 Nov 2004)
New Revision: 8178

Modified:
   icecast/branches/kh/icecast/src/format_mp3.c
Log:
nasty hack for flash clients, in line with trunk/2.1 code


Modified: icecast/branches/kh/icecast/src/format_mp3.c
===================================================================
--- icecast/branches/kh/icecast/src/format_mp3.c	2004-11-06 09:20:30 UTC (rev 8177)
+++ icecast/branches/kh/icecast/src/format_mp3.c	2004-11-06 16:18:55 UTC (rev 8178)
@@ -575,7 +575,10 @@
 {
     mp3_client_data *client_mp3 = calloc(1,sizeof(mp3_client_data));
     mp3_state *source_mp3 = source->format->_state;
-    char *metadata = httpp_getvar(client->parser, "icy-metadata");
+    const char *metadata;
+    unsigned remaining = client->predata_size - client->predata_len + 2;
+    char *ptr = client->predata + client->predata_len - 2;
+    int bytes;
 
     if (client_mp3 == NULL)
     {
@@ -585,13 +588,18 @@
 
     client->format_data = client_mp3;
     client->free_client_data = free_mp3_client_data;
-    
+
+    /* hack for flash player, it wants a length */
+    if (httpp_getvar(client->parser, "x-flash-version"))
+    {
+        bytes = snprintf (ptr, remaining, "Content-Length: 347122319\r\n");
+        remaining -= bytes;
+        ptr += bytes;
+    }
+
+    metadata = httpp_getvar(client->parser, "icy-metadata");
     if (metadata && atoi(metadata) && source_mp3->interval)
     {
-        unsigned remaining = client->predata_size - client->predata_len + 2;
-        char *ptr = client->predata + client->predata_len - 2;
-        int bytes;
-
         if (source_mp3->interval < 0)
             client_mp3->interval = ICY_METADATA_INTERVAL;
         else



More information about the commits mailing list