[xiph-commits] r9419 - in icecast/branches/kh/icecast: doc src

karl at motherfish-iii.xiph.org karl at motherfish-iii.xiph.org
Thu Jun 9 06:56:04 PDT 2005


Author: karl
Date: 2005-06-09 06:55:59 -0700 (Thu, 09 Jun 2005)
New Revision: 9419

Modified:
   icecast/branches/kh/icecast/doc/icecast2_config_file.html
   icecast/branches/kh/icecast/src/admin.c
   icecast/branches/kh/icecast/src/client.h
   icecast/branches/kh/icecast/src/format.c
   icecast/branches/kh/icecast/src/format_mp3.c
   icecast/branches/kh/icecast/src/source.c
Log:
sync-up with recent merge


Modified: icecast/branches/kh/icecast/doc/icecast2_config_file.html
===================================================================
--- icecast/branches/kh/icecast/doc/icecast2_config_file.html	2005-06-09 13:29:11 UTC (rev 9418)
+++ icecast/branches/kh/icecast/doc/icecast2_config_file.html	2005-06-09 13:55:59 UTC (rev 9419)
@@ -279,8 +279,9 @@
 </div>
 <h4>relays-on-demand</h4>
 <div class="indentedbox">
-Changes the default on-demand setting, so a stream is only relayed if listeners are connected.
-(1=enabled, 0=disabled).
+    <p>Changes the default on-demand setting for relays, so a stream is only relayed if
+    listeners are connected. 1=enabled, 0=disabled (default).
+    </p>
 </div>
 
 <br />
@@ -350,8 +351,9 @@
 </div>
 <h4>on-demand</h4>
 <div class="indentedbox">
-An on-demand relay will only retrieve the stream if there are listeners connected
-(1=enabled, 0=disabled).
+    <p>An on-demand relay will only retrieve the stream if there are listeners connected
+    1=enabled, 0=disabled (default is &lt;relays-on-demand&gt;).
+    </p>
 </div>
 <h4>enable</h4>
 <div class="indentedbox">
@@ -463,8 +465,8 @@
 </div>
 <h4>no-yp</h4>
 <div class="indentedbox">
-    <p>Setting this option prevents this mountpoint from advertising on YP.  The default is 0 
-    so YP advertising can occur however you may want to prevent it here if you intend listeners 
+    <p>Setting this option prevents this mountpoint from advertising on YP.  The default is 0
+    so YP advertising can occur however you may want to prevent it here if you intend listeners
     to connect to a local relay instead. Deprecated option, replaced by &lt;public&gt;
     </p>
 </div>
@@ -530,10 +532,11 @@
 </div>
 <h4>mp3-metadata-interval</h4>
 <div class="indentedbox">
-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.
+    <p>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.
+    </p>
 </div>
 <h4>hidden</h4>
 <div class="indentedbox">
@@ -541,12 +544,6 @@
 for cases where a local relay is configured and you do not want the source of the local
 relay to be shown
 </div>
-<h4>mp3-metadata-interval</h4>
-<div class="indentedbox">
-Listeners connecting to an mp3 stream can request metadata be sent to them. That metadata
-is sent every so many bytes, this setting allows for overriding the default for this
-mountpoint. A value of 0 means no metadata is sent to the client even if icecast receives it.
-</div>
 <h4>authentication</h4>
 <div class="indentedbox">
 This specifies that the named mount point will require listener authentication.  Currently, we only support a file-based authentication scheme (type=htpasswd).  Users and encrypted password are placed in this file (separated by a :) and all requests for this mountpoint will require that a user and password be supplied for authentication purposes.  These values are passed in via normal HTTP Basic Authentication means (i.e. http://user:password@stream:port/mountpoint.ogg).  Users and Passwords are maintained via the web admin interface.  A mountpoint configured with an authenticator will display a red key next to the mount point name on the admin screens.  You can read more about listener authentication <a href="icecast2_listenerauth.html">here</a>.

Modified: icecast/branches/kh/icecast/src/admin.c
===================================================================
--- icecast/branches/kh/icecast/src/admin.c	2005-06-09 13:29:11 UTC (rev 9418)
+++ icecast/branches/kh/icecast/src/admin.c	2005-06-09 13:55:59 UTC (rev 9419)
@@ -297,7 +297,6 @@
 
     client->respcode = 200;
     if (response == RAW) {
-        // xmlDocDumpMemory(doc, &buff, &len);
         xmlDocDumpFormatMemoryEnc (doc, &buff, &len, NULL, 1);
         html_write(client, "HTTP/1.0 200 OK\r\n"
                "Content-Length: %d\r\n"

Modified: icecast/branches/kh/icecast/src/client.h
===================================================================
--- icecast/branches/kh/icecast/src/client.h	2005-06-09 13:29:11 UTC (rev 9418)
+++ icecast/branches/kh/icecast/src/client.h	2005-06-09 13:55:59 UTC (rev 9419)
@@ -73,7 +73,10 @@
 
     /* function to call to release format specific resources */
     void (*free_client_data)(struct _client_tag *client);
+
+    /* write out data associated with client */
     int (*write_to_client)(struct _client_tag *client);
+
     /* function to check if refbuf needs updating */
     int (*check_buffer)(struct source_tag *source, struct _client_tag *client);
 

Modified: icecast/branches/kh/icecast/src/format.c
===================================================================
--- icecast/branches/kh/icecast/src/format.c	2005-06-09 13:29:11 UTC (rev 9418)
+++ icecast/branches/kh/icecast/src/format.c	2005-06-09 13:55:59 UTC (rev 9419)
@@ -124,6 +124,7 @@
         {
             client_set_queue (client, refbuf);
             client->check_buffer = format_advance_queue;
+            client->write_to_client = source->format->write_buf_to_client;
             client->intro_offset = -1;
             break;
         }

Modified: icecast/branches/kh/icecast/src/format_mp3.c
===================================================================
--- icecast/branches/kh/icecast/src/format_mp3.c	2005-06-09 13:29:11 UTC (rev 9418)
+++ icecast/branches/kh/icecast/src/format_mp3.c	2005-06-09 13:55:59 UTC (rev 9419)
@@ -291,8 +291,17 @@
     }
     else
     {
-        metadata = "\0";
-        meta_len = 1;
+        if (associated)
+        {
+            metadata = "\0";
+            meta_len = 1;
+        }
+        else
+        {
+            char *meta = "\001StreamTitle='';";
+            metadata = meta + client_mp3->metadata_offset;
+            meta_len = 17 - client_mp3->metadata_offset;
+        }
     }
     ret = client_send_bytes (client, metadata, meta_len);
 
@@ -585,9 +594,6 @@
         return -1;
     }
 
-    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"))
     {
@@ -596,6 +602,8 @@
         ptr += bytes;
     }
 
+    client->format_data = client_mp3;
+    client->free_client_data = free_mp3_client_data;
     metadata = httpp_getvar(client->parser, "icy-metadata");
     if (metadata && atoi(metadata))
     {

Modified: icecast/branches/kh/icecast/src/source.c
===================================================================
--- icecast/branches/kh/icecast/src/source.c	2005-06-09 13:29:11 UTC (rev 9418)
+++ icecast/branches/kh/icecast/src/source.c	2005-06-09 13:55:59 UTC (rev 9419)
@@ -156,10 +156,8 @@
         source = source_find_mount_raw(mount);
         if (source)
         {
-            if (source->running)
+            if (source->running || source->on_demand)
                 break;
-            if (source->on_demand)
-                break;
         }
 
         /* we either have a source which is not active (relay) or no source
@@ -252,7 +250,6 @@
         source->intro_file = NULL;
     }
 
-    source->on_demand = 0;
     source->on_demand_req = 0;
 }
 
@@ -372,7 +369,6 @@
 
         dest->listeners += count;
         source->listeners = 0;
-        source->listeners = 0;
         stats_event (source->mount, "listeners", "0");
 
     } while (0);
@@ -1134,7 +1130,13 @@
     if (mountinfo && mountinfo->on_disconnect)
         DEBUG1 ("disconnect script \"%s\"", mountinfo->on_disconnect);
     if (source->on_demand)
+    {
         DEBUG0 ("on_demand set");
+        stats_event (source->mount, "on_demand", "1");
+    }
+    else
+        stats_event (source->mount, "on_demand", NULL);
+
     if (source->hidden)
     {
         stats_event_hidden (source->mount, NULL, 1);
@@ -1151,10 +1153,6 @@
         snprintf (buf, sizeof (buf), "%ld", source->max_listeners);
         stats_event (source->mount, "max_listeners", buf);
     }
-    if (source->on_demand)
-        stats_event (source->mount, "on_demand", "1");
-    else
-        stats_event (source->mount, "on_demand", NULL);
 
     DEBUG1 ("public set to %d", source->yp_public);
     DEBUG1 ("max listeners to %ld", source->max_listeners);



More information about the commits mailing list