shithub: aacdec

Download patch

ref: d04e5193e35696ba1b3de26d4a3070c281c6cbea
parent: 33656858ad9f69ed9ea1e7fe565f1ce28987205c
author: menno <menno>
date: Wed May 7 14:30:49 EDT 2003

Updated all programs/plugins to work with Apple M4A files as well

--- a/aacDECdrop/decode.c
+++ b/aacDECdrop/decode.c
@@ -16,8 +16,8 @@
 ** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
-** $Id: decode.c,v 1.12 2003/02/09 20:42:46 menno Exp $
-** $Id: decode.c,v 1.12 2003/02/09 20:42:46 menno Exp $
+** $Id: decode.c,v 1.13 2003/05/07 18:30:48 menno Exp $
+** $Id: decode.c,v 1.13 2003/05/07 18:30:48 menno Exp $
 **/
 
 #ifdef _WIN32
@@ -472,6 +472,7 @@
     int mp4file = 0;
     char *fnp;
     char audioFileName[MAX_PATH];
+    MP4FileHandle infile;
 
 
     /* point to the specified file name */
@@ -484,9 +485,11 @@
 
     strcat(audioFileName, file_ext[opt->file_type]);
 
-    fnp = (char *)strrchr(opt->filename, '.');
-    if (!str_no_case_comp(fnp, ".MP4", 4))
-        mp4file = 1;
+    mp4file = 1;
+    infile = MP4Read(audioFileName, 0);
+    if (!infile)
+        mp4file = 0;
+    if (infile) MP4Close(infile);
 
     if (mp4file)
     {
--- a/frontend/main.c
+++ b/frontend/main.c
@@ -16,7 +16,7 @@
 ** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
-** $Id: main.c,v 1.30 2003/04/02 20:07:44 menno Exp $
+** $Id: main.c,v 1.31 2003/05/07 18:30:49 menno Exp $
 **/
 
 #ifdef _WIN32
@@ -476,21 +476,6 @@
     return frameInfo.error;
 }
 
-int str_no_case_comp(char const *str1, char const *str2, unsigned long len)
-{
-    signed int c1 = 0, c2 = 0;
-
-    while (len--) {
-        c1 = tolower(*str1++);
-        c2 = tolower(*str2++);
-
-        if (c1 == 0 || c1 != c2)
-            break;
-    }
-
-    return c1 - c2;
-}
-
 int main(int argc, char *argv[])
 {
     int result;
@@ -505,6 +490,7 @@
     char *fnp;
     char aacFileName[255];
     char audioFileName[255];
+    MP4FileHandle infile;
 
 /* System dependant types */
 #ifdef _WIN32
@@ -649,9 +635,11 @@
         strcat(audioFileName, file_ext[format]);
     }
 
-    fnp = (char *)strrchr(aacFileName, '.');
-    if (!str_no_case_comp(fnp, ".MP4", 4))
-        mp4file = 1;
+    mp4file = 1;
+    infile = MP4Read(aacFileName, 0);
+    if (!infile)
+        mp4file = 0;
+    if (infile) MP4Close(infile);
 
     if (mp4file)
     {
--- a/plugins/QCDMp4/QCDMp4.c
+++ b/plugins/QCDMp4/QCDMp4.c
@@ -16,7 +16,7 @@
 ** along with this program; if not, write to the Free Software 
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
-** $Id: QCDMp4.c,v 1.1 2003/04/28 19:07:57 menno Exp $
+** $Id: QCDMp4.c,v 1.2 2003/05/07 18:30:49 menno Exp $
 **/
 
 //#define DEBUG_OUTPUT
@@ -192,7 +192,7 @@
 	config_read();
 
 	ModInfo->moduleString = "MPEG-4 General Audio Plugin v1.0";
-	ModInfo->moduleExtensions = m_use_for_aac ? "MP4:AAC" : "MP4";
+	ModInfo->moduleExtensions = m_use_for_aac ? "MP4:M4A:AAC" : "MP4:M4A";
 
 	hwndPlayer = (HWND)ModInit->Service(opGetParentWnd, 0, 0, 0);
 	mp4state.filename[0] = 0;
@@ -242,7 +242,7 @@
     config_read();
 
 	ModInfo->moduleString = "MPEG-4 General Audio Plugin v1.0";
-	ModInfo->moduleExtensions = m_use_for_aac ? "MP4:AAC" : "MP4";
+	ModInfo->moduleExtensions = m_use_for_aac ? "MP4:M4A:AAC" : "MP4:M4A";
 
 	// insert menu item into plugin menu
 //	QCDCallbacks->Service(opSetPluginMenuItem, hInstance, IDD_CONFIG, (long)"Mp4 Plug-in");
--- a/plugins/foo_mp4/foo_mp4.cpp
+++ b/plugins/foo_mp4/foo_mp4.cpp
@@ -16,7 +16,7 @@
 ** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
-** $Id: foo_mp4.cpp,v 1.28 2003/04/28 10:16:03 menno Exp $
+** $Id: foo_mp4.cpp,v 1.29 2003/05/07 18:30:49 menno Exp $
 **/
 
 #include <mp4.h>
@@ -35,7 +35,7 @@
 }
 
 DECLARE_COMPONENT_VERSION ("MPEG-4 AAC decoder",
-                           STRIP_REVISION("$Revision: 1.28 $"),
+                           STRIP_REVISION("$Revision: 1.29 $"),
                            "Based on FAAD2 v" FAAD2_VERSION "\nCopyright (C) 2002-2003 http://www.audiocoding.com" );
 
 class input_mp4 : public input
@@ -44,7 +44,7 @@
 
     virtual int test_filename(const char * fn,const char * ext)
     {
-        return !stricmp(ext,"MP4");
+        return (!stricmp(ext,"MP4") || !stricmp(ext,"M4A"));
     }
 
     virtual int open(reader *r, file_info *info, int full_open)
--- a/plugins/in_mp4/in_mp4.c
+++ b/plugins/in_mp4/in_mp4.c
@@ -16,7 +16,7 @@
 ** along with this program; if not, write to the Free Software 
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
-** $Id: in_mp4.c,v 1.26 2003/02/25 17:45:03 menno Exp $
+** $Id: in_mp4.c,v 1.27 2003/05/07 18:30:49 menno Exp $
 **/
 
 //#define DEBUG_OUTPUT
@@ -1132,7 +1132,7 @@
     "AudioCoding.com MPEG-4 General Audio player: " FAAD2_VERSION " compiled on " __DATE__,
     0,  // hMainWindow
     0,  // hDllInstance
-    "MP4\0MPEG-4 Files (*.MP4)\0AAC\0AAC Files (*.AAC)\0"
+    "MP4\0MPEG-4 Files (*.MP4)\0M4A\0MPEG-4 Files (*.M4A)\0AAC\0AAC Files (*.AAC)\0"
     ,
     1, // is_seekable
     1, // uses output