changeset 1372:b861909ec6da trunk

[svn] mpgdec: - fix smart detection of MPEG streams/Xiph containers/MP3X containers/Fraunhofer VBRX containers - use smart detection instead of extension checking - avoid grabbing FLAC streams if mpgdec is loaded before libflac is.
author nenolod
date Tue, 04 Jul 2006 17:29:40 -0700
parents ca4f3115d33c
children 10b899eddd83
files ChangeLog Plugins/Input/mpg123/mpg123.c
diffstat 2 files changed, 18 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Jul 04 04:59:27 2006 -0700
+++ b/ChangeLog	Tue Jul 04 17:29:40 2006 -0700
@@ -1,3 +1,13 @@
+2006-07-04 11:59:27 +0000  William Pitcock <nenolod@nenolod.net>
+  revision [1656]
+  - recursively locate album art, by external contributor Oliver Lumpton.
+  
+
+  Changes:        Modified:
+  +53 -32         trunk/audacious/ui_fileinfo.c  
+  +1 -0           trunk/audacious/ui_fileinfo.h  
+
+
 2006-07-04 07:48:43 +0000  William Pitcock <nenolod@nenolod.net>
   revision [1654]
   - make this a compile-time define
--- a/Plugins/Input/mpg123/mpg123.c	Tue Jul 04 04:59:27 2006 -0700
+++ b/Plugins/Input/mpg123/mpg123.c	Tue Jul 04 17:29:40 2006 -0700
@@ -268,8 +268,7 @@
 }
 
 
-#if 0
-#define DET_BUF_SIZE 1024
+#define DET_BUF_SIZE 4096
 
 static gboolean
 mpgdec_detect_by_content(char *filename)
@@ -293,7 +292,7 @@
          * The mpeg-stream can start anywhere in the file,
          * so we check the entire file
 	 *
-	 * Incorrect! We give up past ten iterations of this
+	 * Incorrect! We give up past twenty iterations of this
 	 * code for safety's sake. Buffer overflows suck. --nenolod
          */
         /* Optimize this */
@@ -310,7 +309,7 @@
             }
         }
 
-        if (++cyc > 20)
+        if (++cyc > 1024)
 	    goto done;
     }
     if (mpgdec_decode_header(&fr, head)) {
@@ -332,19 +331,22 @@
     vfs_fclose(file);
     return ret;
 }
-#endif
 
 static int
 is_our_file(char *filename)
 {
     gchar *ext = strrchr(filename, '.');
 
-    if (!strncasecmp(filename, "http://", 7) && (ext && strncasecmp(ext, ".ogg", 4)))
+    if (!strncasecmp(filename, "http://", 7) && (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;
+#endif
 
     return FALSE;
 }