~ft/aacdec

d04e5193e35696ba1b3de26d4a3070c281c6cbea — menno 18 years ago 3365685
Updated all programs/plugins to work with Apple M4A files as well
M aacDECdrop/decode.c => aacDECdrop/decode.c +8 -5
@@ 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 aac_decode(aac_dec_opt *opt)
    int mp4file = 0;
    char *fnp;
    char audioFileName[MAX_PATH];
    MP4FileHandle infile;


    /* point to the specified file name */


@@ 484,9 485,11 @@ int aac_decode(aac_dec_opt *opt)

    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)
    {

M frontend/main.c => frontend/main.c +7 -19
@@ 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 @@ int decodeMP4file(char *mp4file, char *sndfile, int to_stdout,
    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 @@ int main(int argc, char *argv[])
    char *fnp;
    char aacFileName[255];
    char audioFileName[255];
    MP4FileHandle infile;

/* System dependant types */
#ifdef _WIN32


@@ 649,9 635,11 @@ int main(int argc, char *argv[])
        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)
    {

M plugins/QCDMp4/QCDMp4.c => plugins/QCDMp4/QCDMp4.c +3 -3
@@ 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 @@ PLUGIN_API BOOL QInputModule(QCDModInitIn *ModInit, QCDModInfo *ModInfo)
	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 @@ int Initialize(QCDModInfo *ModInfo, int flags)
    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");

M plugins/foo_mp4/foo_mp4.cpp => plugins/foo_mp4/foo_mp4.cpp +3 -3
@@ 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 @@ char *STRIP_REVISION(const char *str)
}

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 @@ public:

    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)

M plugins/in_mp4/in_mp4.c => plugins/in_mp4/in_mp4.c +2 -2
@@ 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 @@ static In_Module module =
    "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