shithub: aacdec

Download patch

ref: 367d20be44225752b3974addd9789a821f88b692
parent: b5b68e541c7164b5be892b3f56d2d2b2a2f511a2
author: menno <menno>
date: Sun Jan 12 05:18:37 EST 2003

Fixed linux compilation

--- a/common/mp4v2/Makefile.am
+++ b/common/mp4v2/Makefile.am
@@ -5,109 +5,110 @@
 lib_LTLIBRARIES = libmp4v2.la
 
 libmp4v2_la_SOURCES = \
-	atom_co64.cpp \
-	atom_cprt.cpp \
-	atom_ctts.cpp \
-	atom_dimm.cpp \
-	atom_dinf.cpp \
-	atom_dmax.cpp \
-	atom_dmed.cpp \
-	atom_dref.cpp \
-	atom_drep.cpp \
-	atom_edts.cpp \
-	atom_elst.cpp \
-	atom_esds.cpp \
-	atom_free.cpp \
-	atom_ftyp.cpp \
-	atom_hdlr.cpp \
-	atom_hinf.cpp \
-	atom_hmhd.cpp \
-	atom_hnti.cpp \
-	atom_iods.cpp \
-	atom_maxr.cpp \
-	atom_mdat.cpp \
-	atom_mdhd.cpp \
-	atom_mdia.cpp \
-	atom_mfhd.cpp \
-	atom_minf.cpp \
-	atom_moof.cpp \
-	atom_moov.cpp \
-	atom_mp4a.cpp \
-	atom_mp4s.cpp \
-	atom_mp4v.cpp \
-	atom_mvex.cpp \
-	atom_mvhd.cpp \
-	atom_nmhd.cpp \
-	atom_nump.cpp \
-	atom_payt.cpp \
-	atom_pmax.cpp \
-	atom_root.cpp \
-	atom_rtp.cpp \
-	atom_sdp.cpp \
-	atoms.h \
-	atom_smhd.cpp \
-	atom_snro.cpp \
-	atom_stbl.cpp \
-	atom_stco.cpp \
-	atom_stdp.cpp \
-	atom_stsc.cpp \
-	atom_stsd.cpp \
-	atom_stsh.cpp \
-	atom_stss.cpp \
-	atom_stsz.cpp \
-	atom_stts.cpp \
-	atom_tfhd.cpp \
-	atom_tims.cpp \
-	atom_tkhd.cpp \
-	atom_tmax.cpp \
-	atom_tmin.cpp \
-	atom_tpyl.cpp \
-	atom_traf.cpp \
-	atom_trak.cpp \
-	atom_tref.cpp \
-	atom_treftype.cpp \
-	atom_trex.cpp \
-	atom_trpy.cpp \
-	atom_trun.cpp \
-	atom_tsro.cpp \
-	atom_udta.cpp \
-	atom_url.cpp \
-	atom_urn.cpp \
-	atom_vmhd.cpp \
-	descriptors.cpp \
-	descriptors.h \
-	isma.cpp \
-	mp4array.h \
-	mp4atom.cpp \
-	mp4atom.h \
-	mp4common.h \
-	mp4container.cpp \
-	mp4container.h \
-	mp4.h \
-	mp4.cpp \
-	mp4descriptor.cpp \
-	mp4descriptor.h \
-	mp4file.cpp \
-	mp4file.h \
-	mp4file_io.cpp \
-	mp4info.cpp \
-	mp4property.cpp \
-	mp4property.h \
-	mp4track.cpp \
-	mp4track.h \
-	mp4util.cpp \
-	mp4util.h \
-	ocidescriptors.cpp \
-	ocidescriptors.h \
-	odcommands.cpp \
-	odcommands.h \
-	qosqualifiers.cpp \
-	qosqualifiers.h \
-	rtphint.cpp \
-	rtphint.h 
+    atom_co64.cpp \
+    atom_cprt.cpp \
+    atom_ctts.cpp \
+    atom_dimm.cpp \
+    atom_dinf.cpp \
+    atom_dmax.cpp \
+    atom_dmed.cpp \
+    atom_dref.cpp \
+    atom_drep.cpp \
+    atom_edts.cpp \
+    atom_elst.cpp \
+    atom_esds.cpp \
+    atom_free.cpp \
+    atom_ftyp.cpp \
+    atom_hdlr.cpp \
+    atom_hinf.cpp \
+    atom_hmhd.cpp \
+    atom_hnti.cpp \
+    atom_iods.cpp \
+    atom_maxr.cpp \
+    atom_mdat.cpp \
+    atom_mdhd.cpp \
+    atom_mdia.cpp \
+    atom_mfhd.cpp \
+    atom_minf.cpp \
+    atom_moof.cpp \
+    atom_moov.cpp \
+    atom_mp4a.cpp \
+    atom_mp4s.cpp \
+    atom_mp4v.cpp \
+    atom_mvex.cpp \
+    atom_mvhd.cpp \
+    atom_nmhd.cpp \
+    atom_nump.cpp \
+    atom_payt.cpp \
+    atom_pmax.cpp \
+    atom_root.cpp \
+    atom_rtp.cpp \
+    atom_sdp.cpp \
+    atoms.h \
+    atom_smhd.cpp \
+    atom_snro.cpp \
+    atom_stbl.cpp \
+    atom_stco.cpp \
+    atom_stdp.cpp \
+    atom_stsc.cpp \
+    atom_stsd.cpp \
+    atom_stsh.cpp \
+    atom_stss.cpp \
+    atom_stsz.cpp \
+    atom_stts.cpp \
+    atom_tag4.cpp \
+    atom_tfhd.cpp \
+    atom_tims.cpp \
+    atom_tkhd.cpp \
+    atom_tmax.cpp \
+    atom_tmin.cpp \
+    atom_tpyl.cpp \
+    atom_traf.cpp \
+    atom_trak.cpp \
+    atom_tref.cpp \
+    atom_treftype.cpp \
+    atom_trex.cpp \
+    atom_trpy.cpp \
+    atom_trun.cpp \
+    atom_tsro.cpp \
+    atom_udta.cpp \
+    atom_url.cpp \
+    atom_urn.cpp \
+    atom_vmhd.cpp \
+    descriptors.cpp \
+    descriptors.h \
+    isma.cpp \
+    mp4array.h \
+    mp4atom.cpp \
+    mp4atom.h \
+    mp4common.h \
+    mp4container.cpp \
+    mp4container.h \
+    mp4.h \
+    mp4.cpp \
+    mp4descriptor.cpp \
+    mp4descriptor.h \
+    mp4file.cpp \
+    mp4file.h \
+    mp4file_io.cpp \
+    mp4info.cpp \
+    mp4property.cpp \
+    mp4property.h \
+    mp4track.cpp \
+    mp4track.h \
+    mp4util.cpp \
+    mp4util.h \
+    ocidescriptors.cpp \
+    ocidescriptors.h \
+    odcommands.cpp \
+    odcommands.h \
+    qosqualifiers.cpp \
+    qosqualifiers.h \
+    rtphint.cpp \
+    rtphint.h 
 
 EXTRA_DIST = API_CHANGES \
-	INTERNALS \
-	libmp4v260.dsp \
-	libmp4v2_st60.dsp \
-	TODO
+    INTERNALS \
+    libmp4v260.dsp \
+    libmp4v2_st60.dsp \
+    TODO
--- a/common/mp4v2/libmp4v2_cb.vcproj
+++ b/common/mp4v2/libmp4v2_cb.vcproj
@@ -34,7 +34,7 @@
 				WarningLevel="3"
 				SuppressStartupBanner="TRUE"
 				CompileAs="0"
-				AdditionalOptions="&lt;?ICLPrjArgs?&gt; /Qvc7 /Qlocation,link,&quot;E:\Program Files\Microsoft Visual Studio .NET\Vc7\Bin&quot; /c  /I &quot;.\\&quot; /nologo /W3 /O2 /Ob1 /Oy /D &quot;NDEBUG&quot; /D &quot;WIN32&quot; /D &quot;_WINDOWS&quot; /D &quot;USE_FILE_CALLBACKS&quot; /GF /FD /EHsc /MT /GS /Gy /YX&quot;StdAfx.h&quot; /Fp&quot;.\CB_Release/libmp4v2_cb.pch&quot; /Fo&quot;.\CB_Release/&quot; /Fd&quot;.\CB_Release/&quot; /Gd &lt;?/ICLPrjArgs?&gt; &lt;?IVCSpawnPrjArgs?&gt; #$UseNonIntelTool #$BinPath:&quot;E:\Program Files\Intel\Compiler70\IA32\Bin;E:\Program Files\Common Files\Intel\Shared Files\IA32\Bin;E:\Program Files\Microsoft Visual Studio .NET\Common7\IDE&quot; #$LibPath:&quot;E:\Program Files\Intel\Compiler70\IA32\Lib;E:\Program Files\Common Files\Intel\Shared Files\IA32\Lib&quot; #$IncPath:&quot;E:\Program Files\Intel\Compiler70\IA32\Include&quot; &lt;?/IVCSpawnPrjArgs?&gt;">
+				AdditionalOptions="">
 				<IntelOptions
 					Optimization="2"
 					InlineFuncExpansion="1"
@@ -52,7 +52,7 @@
 				Name="VCLibrarianTool"
 				OutputFile=".\CB_Release\libmp4v2_cb.lib"
 				SuppressStartupBanner="TRUE"
-				AdditionalOptions="&lt;?ICLPrjArgs?&gt; /OUT:&quot;.\CB_Release\libmp4v2_cb.lib&quot; /NOLOGO &lt;?/ICLPrjArgs?&gt; &lt;?IVCSpawnPrjArgs?&gt; #$UseNonIntelTool #$BinPath:&quot;E:\Program Files\Intel\Compiler70\IA32\Bin;E:\Program Files\Common Files\Intel\Shared Files\IA32\Bin;E:\Program Files\Microsoft Visual Studio .NET\Common7\IDE&quot; #$LibPath:&quot;E:\Program Files\Intel\Compiler70\IA32\Lib;E:\Program Files\Common Files\Intel\Shared Files\IA32\Lib&quot; #$IncPath:&quot;E:\Program Files\Intel\Compiler70\IA32\Include&quot; &lt;?/IVCSpawnPrjArgs?&gt;">
+				AdditionalOptions="">
 				<IntelOptions
 					AllOptions="/OUT:&quot;.\CB_Release\libmp4v2_cb.lib&quot; /NOLOGO"
 					MSOriginalAdditionalOptions=""/>
@@ -72,7 +72,7 @@
 			<Tool
 				Name="VCWebServiceProxyGeneratorTool"/>
 			<IntelOptions
-				CompilerName="1"/>
+				CompilerName="0"/>
 		</Configuration>
 		<Configuration
 			Name="Debug|Win32"
@@ -97,13 +97,13 @@
 				SuppressStartupBanner="TRUE"
 				DebugInformationFormat="4"
 				CompileAs="0"
-				AdditionalOptions="&lt;?ICLPrjArgs?&gt; /Qvc7 /Qlocation,link,&quot;E:\Program Files\Microsoft Visual Studio .NET\Vc7\Bin&quot; /c  /I &quot;.\\&quot; /ZI /nologo /W3 /Od /D &quot;_DEBUG&quot; /D &quot;WIN32&quot; /D &quot;_WINDOWS&quot; /D &quot;USE_FILE_CALLBACKS&quot; /Gm /EHsc /RTC1 /MDd /YX&quot;StdAfx.h&quot; /Fp&quot;.\CB_Debug/libmp4v2_cb.pch&quot; /Fo&quot;.\CB_Debug/&quot; /Fd&quot;.\CB_Debug/&quot; /Gd &lt;?/ICLPrjArgs?&gt; &lt;?IVCSpawnPrjArgs?&gt; #$UseIntelTool #$BinPath:&quot;E:\Program Files\Intel\Compiler70\IA32\Bin;E:\Program Files\Common Files\Intel\Shared Files\IA32\Bin;E:\Program Files\Microsoft Visual Studio .NET\Common7\IDE&quot; #$LibPath:&quot;E:\Program Files\Intel\Compiler70\IA32\Lib;E:\Program Files\Common Files\Intel\Shared Files\IA32\Lib&quot; #$IncPath:&quot;E:\Program Files\Intel\Compiler70\IA32\Include&quot; &lt;?/IVCSpawnPrjArgs?&gt;">
+				AdditionalOptions="">
 				<IntelOptions
 					Optimization="0"
 					MinimalRebuild="1"
 					BasicRuntimeChecks="3"
 					RuntimeLibrary="3"
-					AllOptions="/c  /I &quot;.\\&quot; /ZI /nologo /W3 /Od /D &quot;_DEBUG&quot; /D &quot;WIN32&quot; /D &quot;_WINDOWS&quot; /D &quot;USE_FILE_CALLBACKS&quot; /Gm /EHsc /RTC1 /MDd /YX&quot;StdAfx.h&quot; /Fp&quot;.\CB_Debug/libmp4v2_cb.pch&quot; /Fo&quot;.\CB_Debug/&quot; /Fd&quot;.\CB_Debug/&quot; /Gd"
+					AllOptions="/c  /I &quot;.\\&quot; /ZI /nologo /W3 /Od /D &quot;_DEBUG&quot; /D &quot;WIN32&quot; /D &quot;_WINDOWS&quot; /D &quot;USE_FILE_CALLBACKS&quot; /Gm /EHsc /RTC1 /MDd /YX&quot;StdAfx.h&quot; /Fp&quot;.\CB_Debug/libmp4v2_cb.pch&quot; /Fo&quot;.\CB_Debug/&quot; /Fd&quot;.\CB_Debug/&quot; /Gd &lt;?ICLPrjArgs?&gt; /Qvc7 /Qlocation,link,&quot;E:\Program Files\Microsoft Visual Studio .NET\Vc7\Bin&quot; /c  /I &quot;.\\&quot; /ZI /nologo /W3 /Od /D &quot;_DEBUG&quot; /D &quot;WIN32&quot; /D &quot;_WINDOWS&quot; /D &quot;USE_FILE_CALLBACKS&quot; /Gm /EHsc /RTC1 /MDd /YX&quot;StdAfx.h&quot; /Fp&quot;.\CB_Debug/libmp4v2_cb.pch&quot; /Fo&quot;.\CB_Debug/&quot; /Fd&quot;.\CB_Debug/&quot; /Gd &lt;?/ICLPrjArgs?&gt; &lt;?IVCSpawnPrjArgs?&gt; #$UseIntelTool #$BinPath:&quot;E:\Program Files\Intel\Compiler70\IA32\Bin;E:\Program Files\Common Files\Intel\Shared Files\IA32\Bin;E:\Program Files\Microsoft Visual Studio .NET\Common7\IDE&quot; #$LibPath:&quot;E:\Program Files\Intel\Compiler70\IA32\Lib;E:\Program Files\Common Files\Intel\Shared Files\IA32\Lib&quot; #$IncPath:&quot;E:\Program Files\Intel\Compiler70\IA32\Include&quot; &lt;?/IVCSpawnPrjArgs?&gt;"
 					MSOriginalAdditionalOptions=""/>
 			</Tool>
 			<Tool
@@ -112,9 +112,9 @@
 				Name="VCLibrarianTool"
 				OutputFile=".\CB_Debug\libmp4v2_cb.lib"
 				SuppressStartupBanner="TRUE"
-				AdditionalOptions="&lt;?ICLPrjArgs?&gt; /OUT:&quot;.\CB_Debug\libmp4v2_cb.lib&quot; /NOLOGO &lt;?/ICLPrjArgs?&gt; &lt;?IVCSpawnPrjArgs?&gt; #$UseIntelTool #$BinPath:&quot;E:\Program Files\Intel\Compiler70\IA32\Bin;E:\Program Files\Common Files\Intel\Shared Files\IA32\Bin;E:\Program Files\Microsoft Visual Studio .NET\Common7\IDE&quot; #$LibPath:&quot;E:\Program Files\Intel\Compiler70\IA32\Lib;E:\Program Files\Common Files\Intel\Shared Files\IA32\Lib&quot; #$IncPath:&quot;E:\Program Files\Intel\Compiler70\IA32\Include&quot; &lt;?/IVCSpawnPrjArgs?&gt;">
+				AdditionalOptions="">
 				<IntelOptions
-					AllOptions="/OUT:&quot;.\CB_Debug\libmp4v2_cb.lib&quot; /NOLOGO"
+					AllOptions="/OUT:&quot;.\CB_Debug\libmp4v2_cb.lib&quot; /NOLOGO &lt;?ICLPrjArgs?&gt; /OUT:&quot;.\CB_Debug\libmp4v2_cb.lib&quot; /NOLOGO &lt;?/ICLPrjArgs?&gt; &lt;?IVCSpawnPrjArgs?&gt; #$UseIntelTool #$BinPath:&quot;E:\Program Files\Intel\Compiler70\IA32\Bin;E:\Program Files\Common Files\Intel\Shared Files\IA32\Bin;E:\Program Files\Microsoft Visual Studio .NET\Common7\IDE&quot; #$LibPath:&quot;E:\Program Files\Intel\Compiler70\IA32\Lib;E:\Program Files\Common Files\Intel\Shared Files\IA32\Lib&quot; #$IncPath:&quot;E:\Program Files\Intel\Compiler70\IA32\Include&quot; &lt;?/IVCSpawnPrjArgs?&gt;"
 					MSOriginalAdditionalOptions=""/>
 			</Tool>
 			<Tool
--- a/common/mp4v2/mp4.cpp
+++ b/common/mp4v2/mp4.cpp
@@ -51,7 +51,7 @@
 }
 
 #ifdef USE_FILE_CALLBACKS
-extern "C" MP4FileHandle MP4ReadCb(const char* fileName, u_int32_t verbosity,
+extern "C" MP4FileHandle MP4ReadCb(u_int32_t verbosity,
                                    MP4OpenCallback MP4fopen,
                                    MP4CloseCallback MP4fclose,
                                    MP4ReadCallback MP4fread,
@@ -76,7 +76,7 @@
         pFile->m_MP4fgetpos = MP4fgetpos;
         pFile->m_MP4filesize = MP4filesize;
 
-		pFile->Read(fileName);
+		pFile->Read("");
 		return (MP4FileHandle)pFile;
 	}
 	catch (MP4Error* e) {
@@ -87,8 +87,8 @@
 	}
 }
 
-extern "C" MP4FileHandle MP4ModifyCb(const char* fileName, 
-	u_int32_t verbosity, bool useExtensibleFormat,
+extern "C" MP4FileHandle MP4ModifyCb(int32_t verbosity,
+    bool useExtensibleFormat,
     MP4OpenCallback MP4fopen, MP4CloseCallback MP4fclose,
     MP4ReadCallback MP4fread, MP4WriteCallback MP4fwrite,
     MP4SetposCallback MP4fsetpos, MP4GetposCallback MP4fgetpos,
@@ -109,7 +109,7 @@
         pFile->m_MP4filesize = MP4filesize;
 
 		// LATER useExtensibleFormat, moov first, then mvex's
-		pFile->Modify(fileName);
+		pFile->Modify("");
 		return (MP4FileHandle)pFile;
 	}
 	catch (MP4Error* e) {
@@ -2518,20 +2518,6 @@
 }
 
 /* tagging functions */
-
-extern "C" void MP4TagCreate(MP4FileHandle hFile, MP4TrackId trackId)
-{
-	if (MP4_IS_VALID_FILE_HANDLE(hFile)) {
-		try {
-			((MP4File*)hFile)->TagCreate(trackId);
-            return;
-		}
-		catch (MP4Error* e) {
-			PRINT_ERROR(e);
-			delete e;
-		}
-	}
-}
 
 extern "C" bool MP4TagDelete(MP4FileHandle hFile, MP4TrackId trackId)
 {
--- a/common/mp4v2/mp4.h
+++ b/common/mp4v2/mp4.h
@@ -236,7 +236,7 @@
 	const char* fileName, 
 	u_int32_t verbosity DEFAULT(0));
 
-MP4FileHandle MP4ReadCb(const char* fileName, u_int32_t verbosity,
+MP4FileHandle MP4ReadCb(u_int32_t verbosity,
                         MP4OpenCallback MP4fopen,
                         MP4CloseCallback MP4fclose,
                         MP4ReadCallback MP4fread,
@@ -246,8 +246,8 @@
                         MP4FilesizeCallback MP4filesize,
                         void *userData);
 
-MP4FileHandle MP4ModifyCb(const char* fileName, 
-	u_int32_t verbosity, bool useExtensibleFormat,
+MP4FileHandle MP4ModifyCb(int32_t verbosity,
+    bool useExtensibleFormat,
     MP4OpenCallback MP4fopen, MP4CloseCallback MP4fclose,
     MP4ReadCallback MP4fread, MP4WriteCallback MP4fwrite,
     MP4SetposCallback MP4fsetpos, MP4GetposCallback MP4fgetpos,
@@ -907,7 +907,6 @@
 	const u_int8_t* pData, 
 	u_int32_t dataSize);
 
-void MP4TagCreate(MP4FileHandle hFile, MP4TrackId trackId);
 bool MP4TagDelete(MP4FileHandle hFile, MP4TrackId trackId);
 bool MP4TagAddEntry(MP4FileHandle hFile, MP4TrackId trackId,
                     const char *name, const char *value);
--- a/common/mp4v2/mp4file.cpp
+++ b/common/mp4v2/mp4file.cpp
@@ -2336,6 +2336,7 @@
         pUdtaAtom = m_pRootAtom->FindAtom(MakeTrackName(trackId, "udta"));
         pTagAtom = m_pRootAtom->FindAtom(MakeTrackName(trackId, "udta.TAG4"));
     }
+    /* there is no tag */
     if (!pUdtaAtom || !pTagAtom)
         return false;
 
@@ -2359,7 +2360,13 @@
     else
         pTagAtom = m_pRootAtom->FindAtom(MakeTrackName(trackId, "udta.TAG4"));
     if (!pTagAtom)
-        return false;
+    {
+        TagCreate(trackId);
+        if (trackId == NULL)
+            pTagAtom = m_pRootAtom->FindAtom("moov.udta.TAG4");
+        else
+            pTagAtom = m_pRootAtom->FindAtom(MakeTrackName(trackId, "udta.TAG4"));
+    }
 
     pTagAtom->FindProperty("TAG4.entryCount",
         (MP4Property**)&pCountProperty);
@@ -2382,7 +2389,7 @@
     return true;
 }
 
-#if 0
+#if 0 // not working
 void MP4File::TagDeleteEntry(MP4TrackId trackId, u_int32_t index)
 {
     MP4TableProperty *pEntryProperty = NULL;
--- a/configure.in
+++ b/configure.in
@@ -33,7 +33,7 @@
                   [$1;],
                   libfaad_ok=yes, libfaad_ok=no)
    if test $libfaad_ok = yes; then
-      AC_DEFINE($3)
+      AC_DEFINE($3, 1, [Define if needed])
       AC_MSG_RESULT([yes])
    else
       AC_MSG_RESULT([no])