[xiph-commits] r8361 - in icecast/branches/kh/icecast: src web
karl at motherfish-iii.xiph.org
karl at motherfish-iii.xiph.org
Fri Dec 10 04:02:23 PST 2004
Author: karl
Date: 2004-12-10 04:02:22 -0800 (Fri, 10 Dec 2004)
New Revision: 8361
Modified:
icecast/branches/kh/icecast/src/format_ogg.c
icecast/branches/kh/icecast/src/format_ogg.h
icecast/branches/kh/icecast/src/format_theora.c
icecast/branches/kh/icecast/src/format_vorbis.c
icecast/branches/kh/icecast/src/yp.c
icecast/branches/kh/icecast/src/yp.h
icecast/branches/kh/icecast/web/status.xsl
Log:
resync with recent changes made to trunk
Modified: icecast/branches/kh/icecast/src/format_ogg.c
===================================================================
--- icecast/branches/kh/icecast/src/format_ogg.c 2004-12-10 00:11:16 UTC (rev 8360)
+++ icecast/branches/kh/icecast/src/format_ogg.c 2004-12-10 12:02:22 UTC (rev 8361)
@@ -247,6 +247,8 @@
char *artist = ogg_info->artist;
char *metadata = NULL;
unsigned int len = 0;
+ ogg_codec_t *codec;
+ char codec_names [100] = "";
if (ogg_info->artist)
{
@@ -279,6 +281,23 @@
}
stats_event (source->mount, "artist", artist);
stats_event (source->mount, "title", title);
+
+ codec = ogg_info->codecs;
+ while (codec)
+ {
+ if (codec->name)
+ {
+ int len = strlen (codec_names);
+ int remaining = sizeof (codec_names) - len;
+ char *where = codec_names + len;
+ char *separator = " ";
+ if (len == 0)
+ separator = "";
+ snprintf (where, remaining, "%s%s", separator, codec->name);
+ }
+ codec = codec->next;
+ }
+ stats_event (source->mount, "subtype", codec_names);
yp_touch (source->mount);
}
Modified: icecast/branches/kh/icecast/src/format_ogg.h
===================================================================
--- icecast/branches/kh/icecast/src/format_ogg.h 2004-12-10 00:11:16 UTC (rev 8360)
+++ icecast/branches/kh/icecast/src/format_ogg.h 2004-12-10 12:02:22 UTC (rev 8361)
@@ -49,6 +49,7 @@
struct ogg_codec_tag *next;
ogg_stream_state os;
unsigned headers;
+ const char *name;
void *specific;
refbuf_t *possible_start;
refbuf_t *page;
Modified: icecast/branches/kh/icecast/src/format_theora.c
===================================================================
--- icecast/branches/kh/icecast/src/format_theora.c 2004-12-10 00:11:16 UTC (rev 8360)
+++ icecast/branches/kh/icecast/src/format_theora.c 2004-12-10 12:02:22 UTC (rev 8361)
@@ -177,6 +177,8 @@
codec->process_page = process_theora_page;
codec->codec_free = theora_codec_free;
codec->headers = 1;
+ codec->name = "Theora";
+
format_ogg_attach_header (ogg_info, page);
ogg_info->codec_sync = codec;
return codec;
Modified: icecast/branches/kh/icecast/src/format_vorbis.c
===================================================================
--- icecast/branches/kh/icecast/src/format_vorbis.c 2004-12-10 00:11:16 UTC (rev 8360)
+++ icecast/branches/kh/icecast/src/format_vorbis.c 2004-12-10 12:02:22 UTC (rev 8361)
@@ -357,6 +357,7 @@
codec->specific = vorbis;
codec->codec_free = vorbis_codec_free;
codec->headers = 1;
+ codec->name = "Vorbis";
free_ogg_packet (vorbis->header[0]);
free_ogg_packet (vorbis->header[1]);
Modified: icecast/branches/kh/icecast/src/yp.c
===================================================================
--- icecast/branches/kh/icecast/src/yp.c 2004-12-10 00:11:16 UTC (rev 8360)
+++ icecast/branches/kh/icecast/src/yp.c 2004-12-10 12:02:22 UTC (rev 8361)
@@ -70,6 +70,7 @@
char *audio_info;
char *server_type;
char *current_song;
+ char *subtype;
struct yp_server *server;
time_t next_update;
@@ -331,6 +332,7 @@
static unsigned do_yp_add (ypdata_t *yp, char *s, unsigned len)
{
int ret;
+ char *value;
if (yp->bitrate == NULL)
{
@@ -342,11 +344,18 @@
return 0;
}
}
+ value = stats_get_value (yp->mount, "subtype");
+ if (value)
+ {
+ add_yp_info (yp, "subtype", value, YP_SUBTYPE);
+ free (value);
+ }
+
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",
+ "%s&url=%s&listenurl=%s&type=%s&stype=%s&b=%s&%s\r\n",
yp->server_name, yp->server_genre, yp->cluster_password,
yp->server_desc, yp->url, yp->listen_url,
- yp->server_type, yp->bitrate, yp->audio_info);
+ yp->server_type, yp->subtype, yp->bitrate, yp->audio_info);
if (ret >= (signed)len)
return ret+1;
if (send_to_yp ("add", yp, s) == 0)
@@ -494,6 +503,7 @@
yp->url = strdup ("");
yp->current_song = strdup ("");
yp->audio_info = strdup ("");
+ yp->subtype = strdup ("");
yp->process = do_yp_add;
url = malloc (len);
@@ -760,9 +770,7 @@
if (ypdata->audio_info) {
free(ypdata->audio_info);
}
- if (ypdata->cluster_password) {
- free(ypdata->cluster_password);
- }
+ free (ypdata->subtype);
free (ypdata->error_msg);
free (ypdata);
}
@@ -775,7 +783,6 @@
if (!info)
return;
- /* DEBUG2 ("stat %s with %s", stat_name, info); */
switch (type)
{
case YP_SERVER_NAME:
@@ -861,6 +868,14 @@
yp->cluster_password = escaped;
}
break;
+ case YP_SUBTYPE:
+ escaped = util_url_escape(info);
+ if (escaped)
+ {
+ free (yp->subtype);
+ yp->subtype = escaped;
+ }
+ break;
}
}
Modified: icecast/branches/kh/icecast/src/yp.h
===================================================================
--- icecast/branches/kh/icecast/src/yp.h 2004-12-10 00:11:16 UTC (rev 8360)
+++ icecast/branches/kh/icecast/src/yp.h 2004-12-10 12:02:22 UTC (rev 8361)
@@ -23,6 +23,7 @@
#define YP_SERVER_TYPE 7
#define YP_CURRENT_SONG 8
#define YP_CLUSTER_PASSWORD 9
+#define YP_SUBTYPE 10
struct source_tag;
Modified: icecast/branches/kh/icecast/web/status.xsl
===================================================================
--- icecast/branches/kh/icecast/web/status.xsl 2004-12-10 00:11:16 UTC (rev 8360)
+++ icecast/branches/kh/icecast/web/status.xsl 2004-12-10 12:02:22 UTC (rev 8361)
@@ -37,6 +37,16 @@
<xsl:if test="quality">
<tr><td>Quality:</td><td class="streamdata"> <xsl:value-of select="quality" /></td></tr>
</xsl:if>
+<xsl:if test="video_quality">
+<tr><td>Video Quality:</td><td class="streamdata"> <xsl:value-of select="video_quality" /></td></tr>
+</xsl:if>
+<xsl:if test="frame_size">
+<tr><td>Framesize:</td><td class="streamdata"> <xsl:value-of select="frame_size" /></td></tr>
+</xsl:if>
+<xsl:if test="frame_rate">
+<tr><td>Framerate:</td><td class="streamdata"> <xsl:value-of select="frame_rate" /></td></tr>
+</xsl:if>
+
<xsl:if test="listeners">
<tr><td>Stream Listeners:</td><td class="streamdata"> <xsl:value-of select="listeners" /></td></tr>
</xsl:if>
More information about the commits
mailing list