changeset 222:eda9699e490e trunk

[svn] - fix magic detection
author nenolod
date Sun, 05 Nov 2006 12:31:33 -0800
parents 8932ad49b51f
children 12346b051297
files ChangeLog src/mpg123/mpg123.c
diffstat 2 files changed, 21 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Nov 05 10:24:30 2006 -0800
+++ b/ChangeLog	Sun Nov 05 12:31:33 2006 -0800
@@ -1,3 +1,11 @@
+2006-11-05 18:24:30 +0000  Jonathan Schleifer <js@h3c.de>
+  revision [442]
+  Fixed crash when a stream is in the playlist.
+  
+  trunk/src/mpg123/mpg123.c |   12 +++---------
+  1 file changed, 3 insertions(+), 9 deletions(-)
+
+
 2006-11-05 10:21:22 +0000  William Pitcock <nenolod@nenolod.net>
   revision [440]
   - allow seeking in http streams that define a content length.
--- a/src/mpg123/mpg123.c	Sun Nov 05 10:24:30 2006 -0800
+++ b/src/mpg123/mpg123.c	Sun Nov 05 12:31:33 2006 -0800
@@ -349,12 +349,22 @@
 {
     gchar *ext = strrchr(filename, '.');
 
-    if (ext && (!strncasecmp(ext, ".mp3", 4)
+    if ((!strncasecmp(filename, "http://", 7)
+#ifdef HAVE_NEMESI
+ || !strncasecmp(filename, "rtsp://", 7)
+#endif
+         ) &&
+        (ext && strncasecmp(ext, ".ogg", 4)) &&
+        (ext && strncasecmp(ext, ".flac", 5)))
+	return TRUE;
+    else if (mpgdec_detect_by_content(filename))
+        return TRUE;
+#if 0
+    else if (ext && (!strncasecmp(ext, ".mp3", 4)
 	|| !strncasecmp(ext, ".mp2", 4)
 	|| !strncasecmp(ext, ".mpg", 4)))
         return TRUE;
-    else if (mpgdec_detect_by_content(filename))
-        return TRUE;
+#endif
 
     return FALSE;
 }