[xiph-cvs] cvs commit: icecast/src format.c format.h connection.c

Michael Smith msmith at xiph.org
Fri Feb 14 02:31:21 PST 2003



msmith      03/02/14 05:31:21

  Modified:    src      format.c format.h connection.c
  Log:
  Fix incorrect use of enum that was leading to crashes on source connect for
  unknown mimetype.

Revision  Changes    Path
1.16      +1 -1      icecast/src/format.c

Index: format.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/format.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- format.c	11 Feb 2003 14:23:34 -0000	1.15
+++ format.c	14 Feb 2003 10:31:21 -0000	1.16
@@ -36,7 +36,7 @@
     else if(strcmp(contenttype, "audio/mpeg") == 0)
         return FORMAT_TYPE_MP3; 
     else
-        return -1;
+        return FORMAT_ERROR;
 }
 
 char *format_get_mimetype(format_type_t type)

<p><p>1.10      +2 -1      icecast/src/format.h

Index: format.h
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/format.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- format.h	30 Dec 2002 07:55:56 -0000	1.9
+++ format.h	14 Feb 2003 10:31:21 -0000	1.10
@@ -14,7 +14,8 @@
 typedef enum _format_type_tag
 {
         FORMAT_TYPE_VORBIS,
-	FORMAT_TYPE_MP3
+	FORMAT_TYPE_MP3,
+    FORMAT_ERROR /* No format, source not processable */
 } format_type_t;
 
 typedef struct _format_plugin_tag

<p><p>1.50      +1 -1      icecast/src/connection.c

Index: connection.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/connection.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- connection.c	13 Feb 2003 11:29:07 -0000	1.49
+++ connection.c	14 Feb 2003 10:31:21 -0000	1.50
@@ -313,7 +313,7 @@
 
         if (contenttype != NULL) {
                 format_type_t format = format_get_type(contenttype);
-		if (format < 0) {
+		if (format == FORMAT_ERROR) {
                         WARN1("Content-type \"%s\" not supported, dropping source", contenttype);
             goto fail;
                 } 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