[xiph-commits] r9877 - icecast/trunk/icecast/src
karl at svn.xiph.org
karl at svn.xiph.org
Tue Aug 30 18:28:05 PDT 2005
Author: karl
Date: 2005-08-30 18:28:04 -0700 (Tue, 30 Aug 2005)
New Revision: 9877
Modified:
icecast/trunk/icecast/src/format_mp3.c
Log:
2 updates to mp3 metadata handling. allow a 0 metadata interval to disable
metadata being sent to new listeners (negative for whatever the source
sends), existing listeners retain their original interval setting. We now
limit how much mp3 is written after the metadata block in a single format
send call, this was only showing up on small interval values.
Modified: icecast/trunk/icecast/src/format_mp3.c
===================================================================
--- icecast/trunk/icecast/src/format_mp3.c 2005-08-31 01:13:25 UTC (rev 9876)
+++ icecast/trunk/icecast/src/format_mp3.c 2005-08-31 01:28:04 UTC (rev 9877)
@@ -197,7 +197,7 @@
{
mp3_state *source_mp3 = format->_state;
- if (mount == NULL || mount->mp3_meta_interval <= 0)
+ if (mount == NULL || mount->mp3_meta_interval < 0)
{
char *metadata = httpp_getvar (client->parser, "icy-metaint");
source_mp3->interval = -1;
@@ -376,6 +376,9 @@
/* change buf and len */
buf += remaining;
len -= remaining;
+ /* limit how much mp3 we send if using small intervals */
+ if (len > client_mp3->interval)
+ len = client_mp3->interval;
}
}
/* write any mp3, maybe after the metadata block */
@@ -635,16 +638,19 @@
metadata = httpp_getvar(client->parser, "icy-metadata");
if (metadata && atoi(metadata))
{
- if (source_mp3->interval > 0)
+ if (source_mp3->interval >= 0)
client_mp3->interval = source_mp3->interval;
else
client_mp3->interval = ICY_METADATA_INTERVAL;
- bytes = snprintf (ptr, remaining, "icy-metaint:%u\r\n",
- client_mp3->interval);
- if (bytes > 0)
+ if (client_mp3->interval)
{
- remaining -= bytes;
- ptr += bytes;
+ bytes = snprintf (ptr, remaining, "icy-metaint:%u\r\n",
+ client_mp3->interval);
+ if (bytes > 0)
+ {
+ remaining -= bytes;
+ ptr += bytes;
+ }
}
}
bytes = snprintf (ptr, remaining, "\r\n");
More information about the commits
mailing list