[xiph-cvs] cvs commit: icecast/src format.h format_mp3.c format_vorbis.c
Karl Heyes
karl at xiph.org
Wed Feb 25 12:23:08 PST 2004
karl 04/02/25 15:23:07
Modified: src format.h format_mp3.c format_vorbis.c
Log:
send mp3 url metadata into a format specific routine
Revision Changes Path
1.15 +1 -1 icecast/src/format.h
Index: format.h
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/format.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- format.h 29 Jan 2004 01:02:06 -0000 1.14
+++ format.h 25 Feb 2004 20:23:07 -0000 1.15
@@ -54,7 +54,7 @@
struct source_tag *source, client_t *client);
void (*client_send_headers)(struct _format_plugin_tag *format,
struct source_tag *source, client_t *client);
-
+ void (*set_tag)(struct _format_plugin_tag *plugin, char *tag, char *value);
void (*free_plugin)(struct _format_plugin_tag *self);
/* for internal state management */
<p><p>1.33 +15 -0 icecast/src/format_mp3.c
Index: format_mp3.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/format_mp3.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- format_mp3.c 10 Feb 2004 04:37:30 -0000 1.32
+++ format_mp3.c 25 Feb 2004 20:23:07 -0000 1.33
@@ -63,6 +63,7 @@
client_t *client, unsigned char *buf, int len);
static void format_mp3_send_headers(format_plugin_t *self,
source_t *source, client_t *client);
+static void mp3_set_tag (format_plugin_t *plugin, char *tag, char *value);
typedef struct {
int use_metadata;
@@ -88,6 +89,7 @@
plugin->create_client_data = format_mp3_create_client_data;
plugin->client_send_headers = format_mp3_send_headers;
plugin->free_plugin = format_mp3_free_plugin;
+ plugin->set_tag = mp3_set_tag;
plugin->format_description = "MP3 audio";
plugin->_state = state;
@@ -103,6 +105,19 @@
return plugin;
}
+
+static void mp3_set_tag (format_plugin_t *plugin, char *tag, char *value)
+{
+ mp3_state *state = plugin->_state;
+
+ thread_mutex_lock(&(state->lock));
+ free(state->metadata);
+ state->metadata = strdup(value);
+ state->metadata_age++;
+ thread_mutex_unlock(&(state->lock));
+}
+
+
static int send_metadata(client_t *client, mp3_client_data *client_state,
mp3_state *source_state)
{
<p><p>1.18 +1 -0 icecast/src/format_vorbis.c
Index: format_vorbis.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/format_vorbis.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- format_vorbis.c 29 Jan 2004 01:02:06 -0000 1.17
+++ format_vorbis.c 25 Feb 2004 20:23:07 -0000 1.18
@@ -77,6 +77,7 @@
plugin->create_client_data = format_vorbis_create_client_data;
plugin->client_send_headers = format_vorbis_send_headers;
plugin->free_plugin = format_vorbis_free_plugin;
+ plugin->set_tag = NULL;
plugin->format_description = "Ogg Vorbis";
state = (vstate_t *)calloc(1, sizeof(vstate_t));
<p><p>--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the commits
mailing list