[xiph-commits] r8305 - icecast/branches/kh/icecast/src
karl at motherfish-iii.xiph.org
karl at motherfish-iii.xiph.org
Mon Nov 29 09:37:04 PST 2004
Author: karl
Date: 2004-11-29 09:37:04 -0800 (Mon, 29 Nov 2004)
New Revision: 8305
Modified:
icecast/branches/kh/icecast/src/admin.c
icecast/branches/kh/icecast/src/format_ogg.c
icecast/branches/kh/icecast/src/format_vorbis.c
icecast/branches/kh/icecast/src/yp.c
Log:
fixup YP updating
Modified: icecast/branches/kh/icecast/src/admin.c
===================================================================
--- icecast/branches/kh/icecast/src/admin.c 2004-11-29 15:45:57 UTC (rev 8304)
+++ icecast/branches/kh/icecast/src/admin.c 2004-11-29 17:37:04 UTC (rev 8305)
@@ -926,7 +926,7 @@
{
if (song)
{
- plugin->set_tag (plugin, "title", song);
+ plugin->set_tag (plugin, "song", song);
INFO2("Metadata on mountpoint %s changed to \"%s\"", source->mount, song);
}
else
Modified: icecast/branches/kh/icecast/src/format_ogg.c
===================================================================
--- icecast/branches/kh/icecast/src/format_ogg.c 2004-11-29 15:45:57 UTC (rev 8304)
+++ icecast/branches/kh/icecast/src/format_ogg.c 2004-11-29 17:37:04 UTC (rev 8305)
@@ -269,7 +269,10 @@
logging_playlist (source->mount, metadata, source->listeners);
free (metadata);
}
- yp_touch (ogg_info->mount);
+ stats_event (source->mount, "artist", artist);
+ stats_event (source->mount, "title", title);
+ DEBUG0 ("running touch");
+ yp_touch (source->mount);
}
Modified: icecast/branches/kh/icecast/src/format_vorbis.c
===================================================================
--- icecast/branches/kh/icecast/src/format_vorbis.c 2004-11-29 15:45:57 UTC (rev 8304)
+++ icecast/branches/kh/icecast/src/format_vorbis.c 2004-11-29 17:37:04 UTC (rev 8305)
@@ -332,6 +332,7 @@
{
ogg_packet header;
vorbis_codec_t *source_vorbis = codec->specific;
+ char *comment;
DEBUG1 ("processing incoming header packet (%d)", codec->headers);
while (codec->headers < 3)
@@ -356,7 +357,21 @@
DEBUG0 ("we have the header packets now");
/* we have all headers */
+ free (ogg_info->title);
+ comment = vorbis_comment_query (&source_vorbis->vc, "TITLE", 0);
+ if (comment)
+ ogg_info->title = strdup (comment);
+ else
+ ogg_info->title = NULL;
+ free (ogg_info->artist);
+ comment = vorbis_comment_query (&source_vorbis->vc, "ARTIST", 0);
+ if (comment)
+ ogg_info->artist = strdup (comment);
+ else
+ ogg_info->artist = NULL;
+ ogg_info->log_metadata = 1;
+
stats_event_args (ogg_info->mount, "audio-samplerate", "%ld", (long)source_vorbis->vi.rate);
stats_event_args (ogg_info->mount, "audio-channels", "%ld", (long)source_vorbis->vi.channels);
stats_event_args (ogg_info->mount, "audio-bitrate", "%ld", (long)source_vorbis->vi.bitrate_nominal);
@@ -365,7 +380,6 @@
/* set queued pages to contain a 1/4 of a second worth of samples */
source_vorbis->page_samples_trigger = source_vorbis->vi.rate / 4;
- /* printf ("finished with incoming header packets\n"); */
source_vorbis->process_packet = process_vorbis_headers;
return 1;
@@ -468,6 +482,7 @@
{
free (ogg_info->artist);
free (ogg_info->title);
+ ogg_info->artist = NULL;
ogg_info->title = p;
change = 1;
}
@@ -554,6 +569,7 @@
stats_event_args (ogg_info->mount, "audio-samplerate", "%ld", (long)vorbis->vi.rate);
stats_event_args (ogg_info->mount, "audio-channels", "%ld", (long)vorbis->vi.channels);
stats_event_args (ogg_info->mount, "audio-bitrate", "%ld", (long)vorbis->vi.bitrate_nominal);
+ stats_event_args (ogg_info->mount, "ice-bitrate", "%ld", (long)vorbis->vi.bitrate_nominal/1000);
ogg_info->log_metadata = 1;
}
return NULL;
Modified: icecast/branches/kh/icecast/src/yp.c
===================================================================
--- icecast/branches/kh/icecast/src/yp.c 2004-11-29 15:45:57 UTC (rev 8304)
+++ icecast/branches/kh/icecast/src/yp.c 2004-11-29 17:37:04 UTC (rev 8305)
@@ -338,6 +338,7 @@
if (yp->bitrate == NULL)
{
yp->next_update = time(NULL) + 5;
+ WARN1 ("mount \"%s\" bitrate unknown, cannot add to YP", yp->mount);
return 0;
}
}
@@ -923,7 +924,7 @@
if (yp)
{
/* we may of found old entries not purged yet, so skip them */
- if (yp->release == 0 || yp->remove == 0)
+ if (yp->release != 0 || yp->remove != 0)
{
search_list = yp->next;
continue;
More information about the commits
mailing list