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

karl at motherfish-iii.xiph.org karl at motherfish-iii.xiph.org
Thu Oct 14 17:45:39 PDT 2004


Author: karl
Date: 2004-10-14 17:45:39 -0700 (Thu, 14 Oct 2004)
New Revision: 8003

Modified:
   icecast/branches/kh/icecast/src/format_vorbis.c
   icecast/branches/kh/icecast/src/yp.c
Log:
small logging and stats update and only do add to server if we have a bitrate


Modified: icecast/branches/kh/icecast/src/format_vorbis.c
===================================================================
--- icecast/branches/kh/icecast/src/format_vorbis.c	2004-10-14 20:33:25 UTC (rev 8002)
+++ icecast/branches/kh/icecast/src/format_vorbis.c	2004-10-15 00:45:39 UTC (rev 8003)
@@ -442,16 +442,21 @@
     tag = vorbis_comment_query (&source_vorbis->vc, "TITLE", 0);
     if (tag == NULL)
         tag = "unknown";
+    else
+        INFO1 ("title set to \"%s\"", tag);
     stats_event (source->mount, "title", tag);
 
     tag = vorbis_comment_query (&source_vorbis->vc, "ARTIST", 0);
     if (tag == NULL)
         tag = "unknown";
+    else
+        INFO1 ("artist set to \"%s\"", tag);
     stats_event (source->mount, "artist", tag);
 
     stats_event_args (source->mount, "audio-samplerate", "%ld", (long)source_vorbis->vi.rate);
     stats_event_args (source->mount, "audio-channels", "%ld", (long)source_vorbis->vi.channels);
     stats_event_args (source->mount, "audio-bitrate", "%ld", (long)source_vorbis->vi.bitrate_nominal);
+    stats_event_args (source->mount, "ice-bitrate", "%ld", (long)source_vorbis->vi.bitrate_nominal/1000);
     /* set queued pages to contain a 1/4 of a second worth of samples */
     source_vorbis->page_samples_trigger = source_vorbis->vi.rate / 4;
 

Modified: icecast/branches/kh/icecast/src/yp.c
===================================================================
--- icecast/branches/kh/icecast/src/yp.c	2004-10-14 20:33:25 UTC (rev 8002)
+++ icecast/branches/kh/icecast/src/yp.c	2004-10-15 00:45:39 UTC (rev 8003)
@@ -332,6 +332,15 @@
 {
     int ret;
 
+    if (yp->bitrate == NULL)
+    {
+        yp->bitrate = stats_get_value (yp->mount, "ice-bitrate");
+        if (yp->bitrate == NULL)
+        {
+            yp->next_update = time(NULL) + 5;
+            return 0;
+        }
+    }
     ret = snprintf (s, len, "action=add&sn=%s&genre=%s&cpswd=%s&desc="
                     "%s&url=%s&listenurl=%s&type=%s&b=%s&%s\r\n",
                     yp->server_name, yp->server_genre, yp->cluster_password,
@@ -468,7 +477,6 @@
         yp->server_name = strdup ("");
         yp->server_desc = strdup ("");
         yp->server_genre = strdup ("");
-        yp->bitrate = strdup ("");
         yp->server_desc = strdup ("");
         yp->server_type = strdup ("");
         yp->cluster_password = strdup ("");



More information about the commits mailing list