[xiph-cvs] cvs commit: icecast/src format_mp3.c

Michael Smith msmith at xiph.org
Tue Dec 31 23:31:46 PST 2002



msmith      03/01/01 02:31:46

  Modified:    src      format_mp3.c
  Log:
  indentation fixes, and a small fix for tracking bytes sent.

Revision  Changes    Path
1.11      +10 -6     icecast/src/format_mp3.c

Index: format_mp3.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/format_mp3.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- format_mp3.c	31 Dec 2002 20:15:03 -0000	1.10
+++ format_mp3.c	1 Jan 2003 07:31:46 -0000	1.11
@@ -93,13 +93,15 @@
         return 0;
     }
 
-    fullmetadata_size = strlen(source_state->metadata) + strlen("StreamTitle='';StreamUrl=''") + 1;
+    fullmetadata_size = strlen(source_state->metadata) + 
+        strlen("StreamTitle='';StreamUrl=''") + 1;
 
     fullmetadata = alloca(fullmetadata_size);
 
     memset(fullmetadata, 0, fullmetadata_size);
 
-    sprintf(fullmetadata, "StreamTitle='%s';StreamUrl=''", source_state->metadata);
+    sprintf(fullmetadata, "StreamTitle='%s';StreamUrl=''", 
+            source_state->metadata);
 
     source_age = source_state->metadata_age;
     send_metadata = source_age != client_state->metadata_age;
@@ -117,8 +119,8 @@
     buf[0] = len_byte;
 
     if (len > 1) {
-	    strncpy(buf+1, fullmetadata + client_state->metadata_offset, len-2);
-	    DEBUG1("Sending metadata (%s)", buf+1);
+        strncpy(buf+1, fullmetadata + client_state->metadata_offset, len-2);
+        DEBUG1("Sending metadata (%s)", buf+1);
     }
 
     thread_mutex_unlock(&(source_state->lock));
@@ -160,8 +162,10 @@
         }
         else {
             ret = send_metadata(client, state, self->_state);
-	    ret = 0;
-	}
+            if(ret > 0)
+                client->con->sent_bytes += ret;
+            ret = 0;
+        }
 
     }
     else {

<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