[icecast-dev] BUG: sending bad buf's in MP3

Michael Smith msmith at labyrinth.net.au
Thu Jan 23 15:49:15 PST 2003



Ricardo Galli <gallir at uib.es> said:

> 
> In format_mp3.c
> 
> static int format_mp3_write_buf_to_client(format_plugin_t *self,
>     client_t *client, unsigned char *buf, int len)
> {
>     int ret;
> 
>     if(((mp3_state *)self->_state)->metadata)
>         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> This is always true because previously it did state->metadata = strdup("") 
> in format_mp3_get_plugin().
> 
> It causes annoying artifacts in xmms while listening mp3, I suposse 
> because xmms didn't ask for metadata.
> 

Ricardo,

Yes, this looks like a bug. I wrote this blind (I have no mp3 source clients,
so it got committed completely untested. I think it's been tested since (by
oddsock at least), but possibly only with metadata-using clients.

Suggest this (untested - I'm at work and can't even compile icecast right now)
patch:

RCS file: /usr/local/cvsroot/icecast/src/format_mp3.c,v
retrieving revision 1.12
diff -u -r1.12 format_mp3.c
--- format_mp3.c        18 Jan 2003 12:30:29 -0000      1.12
+++ format_mp3.c        23 Jan 2003 23:45:03 -0000
@@ -143,10 +143,10 @@
     client_t *client, unsigned char *buf, int len) 
 {
     int ret;
+    mp3_client_data *state = client->format_data;
     
-    if(((mp3_state *)self->_state)->metadata) 
+    if(((mp3_state *)self->_state)->metadata && state->use_metadata) 
     {
-        mp3_client_data *state = client->format_data;
         int max = state->interval - state->offset;
 
         if(len == 0) /* Shouldn't happen */

<p>Mike

--- >8 ----
List archives:  http://www.xiph.org/archives/
icecast project homepage: http://www.icecast.org/
To unsubscribe from this list, send a message to 'icecast-dev-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 Icecast-dev mailing list