shithub: aacdec

Download patch

ref: 5a1ffaa6a50fd05e7a4a8079941d1b7eb2ef3db9
parent: 922513e1151f9cfa68768e4d7d0d914d5b1248a2
author: menno <menno>
date: Tue Dec 23 13:53:24 EST 2003

small changes in mp4ff

--- a/common/mp4ff/mp4ff.c
+++ b/common/mp4ff/mp4ff.c
@@ -22,7 +22,7 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
 **
-** $Id: mp4ff.c,v 1.11 2003/12/15 17:48:33 menno Exp $
+** $Id: mp4ff.c,v 1.12 2003/12/23 18:53:24 menno Exp $
 **/
 
 #include <stdlib.h>
@@ -376,10 +376,30 @@
 
     mp4ff_set_sample_position(f, track, sample);
 
-    result = mp4ff_read_data(f, *audio_buffer, *bytes);
+    return mp4ff_read_data(f, *audio_buffer, *bytes);
 
     if (!result)
+	{
+		free(*audio_buffer);
+		*audio_buffer = 0;
         return 0;
+	}
 
     return *bytes;
+}
+
+
+int32_t mp4ff_read_sample_v2(mp4ff_t *f, const int track, const int sample,unsigned char *buffer)
+{
+	int32_t size = mp4ff_audio_frame_size(f,track,sample);
+	if (size<=0) return 0;
+	mp4ff_set_sample_position(f, track, sample);
+	return mp4ff_read_data(f,buffer,size);
+}
+
+int32_t mp4ff_read_sample_getsize(mp4ff_t *f, const int track, const int sample)
+{
+	int32_t temp = mp4ff_audio_frame_size(f, track, sample);
+	if (temp<0) temp = 0;
+	return temp;
 }
--- a/common/mp4ff/mp4ff.h
+++ b/common/mp4ff/mp4ff.h
@@ -22,7 +22,7 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
 **
-** $Id: mp4ff.h,v 1.14 2003/12/15 17:48:33 menno Exp $
+** $Id: mp4ff.h,v 1.15 2003/12/23 18:53:24 menno Exp $
 **/
 
 #ifndef MP4FF_H
@@ -58,8 +58,15 @@
 int32_t mp4ff_get_sample_offset(const mp4ff_t *f, const int32_t track, const int32_t sample);
 int32_t mp4ff_find_sample(const mp4ff_t *f, const int32_t track, const int64_t offset,int32_t * toskip);
 int32_t mp4ff_find_sample_use_offsets(const mp4ff_t *f, const int32_t track, const int64_t offset,int32_t * toskip);
+
 int32_t mp4ff_read_sample(mp4ff_t *f, const int track, const int sample,
                           unsigned char **audio_buffer,  unsigned int *bytes);
+
+int32_t mp4ff_read_sample_v2(mp4ff_t *f, const int track, const int sample,unsigned char *buffer);//returns 0 on error, number of bytes read on success, use mp4ff_read_sample_getsize() to check buffer size needed
+int32_t mp4ff_read_sample_getsize(mp4ff_t *f, const int track, const int sample);//returns 0 on error, buffer size needed for mp4ff_read_sample_v2() on success
+
+
+
 int32_t mp4ff_get_decoder_config(const mp4ff_t *f, const int track,
                              unsigned char** ppBuf, unsigned int* pBufSize);
 int32_t mp4ff_get_track_type(const mp4ff_t *f, const int track);
--- a/common/mp4ff/mp4ff.vcproj
+++ b/common/mp4ff/mp4ff.vcproj
@@ -1,316 +1,237 @@
-<?xml version="1.0" encoding = "Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="mp4ff"
-	ProjectGUID="{F470BB4A-7675-4D6A-B310-41F33AC6F987}"
-	SccProjectName=""
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject 
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="mp4ff"
+	ProjectGUID="{F470BB4A-7675-4D6A-B310-41F33AC6F987}"
+	SccProjectName=""
 	SccLocalPath="">
 	<Platforms>
-		<Platform
+		<Platform 
 			Name="Win32"/>
 	</Platforms>
 	<Configurations>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="4"
-			UseOfMFC="0"
+		<Configuration 
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="4"
+			UseOfMFC="0"
 			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="1"
-				InlineFunctionExpansion="1"
-				PreprocessorDefinitions="USE_TAGGING"
-				StringPooling="TRUE"
-				RuntimeLibrary="0"
-				EnableFunctionLevelLinking="TRUE"
-				UsePrecompiledHeader="2"
-				PrecompiledHeaderFile=".\Release/mp4ff.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				AdditionalOptions="">
-				<IntelOptions
-					Optimization="1"
-					InlineFunctionExpansion="1"
-					OmitFramePointers="1"
-					StringPooling="1"
-					RuntimeLibrary="0"
-					BufferSecurityCheck="1"
-					EnableFunctionLevelLinking="1"
-					AllOptions="/c  /nologo /W3 /O1 /Ob1 /Oy /D &quot;USE_TAGGING&quot; /GF /FD /EHsc /MT /GS /Gy /YX&quot;StdAfx.h&quot; /Fp&quot;.\Release/mp4ff.pch&quot; /Fo&quot;.\Release/&quot; /Fd&quot;.\Release/&quot; /Gd /TP"
-					MSOriginalAdditionalOptions=""/>
-			</Tool>
-			<Tool
+			<Tool 
+				Name="VCCLCompilerTool"
+				AdditionalOptions=""
+				Optimization="1"
+				InlineFunctionExpansion="1"
+				PreprocessorDefinitions="USE_TAGGING"
+				StringPooling="TRUE"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="2"
+				PrecompiledHeaderFile=".\Release/mp4ff.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				Detect64BitPortabilityProblems="TRUE"/>
+			<Tool 
 				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLibrarianTool"
-				OutputFile=".\Release\mp4ff.lib"
-				SuppressStartupBanner="TRUE"
-				AdditionalOptions="">
-				<IntelOptions
-					AllOptions="/OUT:&quot;.\Release\mp4ff.lib&quot; /NOLOGO"
-					MSOriginalAdditionalOptions=""/>
-			</Tool>
-			<Tool
+			<Tool 
+				Name="VCLibrarianTool"
+				AdditionalOptions=""
+				OutputFile=".\Release\mp4ff.lib"
+				SuppressStartupBanner="TRUE"/>
+			<Tool 
 				Name="VCMIDLTool"/>
-			<Tool
+			<Tool 
 				Name="VCPostBuildEventTool"/>
-			<Tool
+			<Tool 
 				Name="VCPreBuildEventTool"/>
-			<Tool
+			<Tool 
 				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
+			<Tool 
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
 				Culture="1043"/>
-			<Tool
+			<Tool 
 				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
+			<Tool 
 				Name="VCXMLDataGeneratorTool"/>
-			<Tool
+			<Tool 
 				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
+			<Tool 
 				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-			<IntelOptions
-				CompilerName="1"/>
 		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="4"
-			UseOfMFC="0"
+		<Configuration 
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="4"
+			UseOfMFC="0"
 			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				PreprocessorDefinitions="USE_TAGGING"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="2"
-				PrecompiledHeaderFile=".\Debug/mp4ff.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="4"
-				AdditionalOptions="">
-				<IntelOptions
-					Optimization="0"
-					MinimalRebuild="1"
-					BasicRuntimeChecks="3"
-					RuntimeLibrary="3"
-					AllOptions="/c  /ZI /nologo /W3 /Od /D &quot;USE_TAGGING&quot; /Gm /EHsc /RTC1 /MDd /YX&quot;StdAfx.h&quot; /Fp&quot;.\Debug/mp4ff.pch&quot; /Fo&quot;.\Debug/&quot; /Fd&quot;.\Debug/&quot; /Gd /TP"
-					MSOriginalAdditionalOptions=""/>
-			</Tool>
-			<Tool
+			<Tool 
+				Name="VCCLCompilerTool"
+				AdditionalOptions=""
+				Optimization="0"
+				PreprocessorDefinitions="USE_TAGGING"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="2"
+				PrecompiledHeaderFile=".\Debug/mp4ff.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool 
 				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLibrarianTool"
-				OutputFile=".\Debug\mp4ff.lib"
-				SuppressStartupBanner="TRUE"
-				AdditionalOptions="">
-				<IntelOptions
-					AllOptions="/OUT:&quot;.\Debug\mp4ff.lib&quot; /NOLOGO"
-					MSOriginalAdditionalOptions=""/>
-			</Tool>
-			<Tool
+			<Tool 
+				Name="VCLibrarianTool"
+				AdditionalOptions=""
+				OutputFile=".\Debug\mp4ff.lib"
+				SuppressStartupBanner="TRUE"/>
+			<Tool 
 				Name="VCMIDLTool"/>
-			<Tool
+			<Tool 
 				Name="VCPostBuildEventTool"/>
-			<Tool
+			<Tool 
 				Name="VCPreBuildEventTool"/>
-			<Tool
+			<Tool 
 				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
+			<Tool 
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
 				Culture="1043"/>
-			<Tool
+			<Tool 
 				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
+			<Tool 
 				Name="VCXMLDataGeneratorTool"/>
-			<Tool
+			<Tool 
 				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
+			<Tool 
 				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-			<IntelOptions
-				CompilerName="1"/>
 		</Configuration>
 	</Configurations>
-	<References/>
+	<References>
+	</References>
 	<Files>
-		<Filter
-			Name="Source Files"
+		<Filter 
+			Name="Source Files"
 			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
-			<File
+			<File 
 				RelativePath="mp4atom.c">
-				<FileConfiguration
+				<FileConfiguration 
 					Name="Release|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="1"
-						PreprocessorDefinitions=""
-						AdditionalOptions="">
-						<IntelOptions
-							Optimization="1"
-							AllOptions="/c  /nologo /W3 /O1 /Ob1 /Oy /D &quot;USE_TAGGING&quot; /GF /FD /EHsc /MT /GS /Gy /YX&quot;StdAfx.h&quot; /Fp&quot;.\Release/mp4ff.pch&quot; /Fo&quot;.\Release/&quot; /Fd&quot;.\Release/&quot; /Gd /TC"
-							MSOriginalAdditionalOptions=""/>
-					</Tool>
+					<Tool 
+						Name="VCCLCompilerTool"
+						AdditionalOptions=""
+						Optimization="1"
+						PreprocessorDefinitions=""/>
 				</FileConfiguration>
-				<FileConfiguration
+				<FileConfiguration 
 					Name="Debug|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="0"
-						PreprocessorDefinitions=""
-						BasicRuntimeChecks="3"
-						AdditionalOptions="">
-						<IntelOptions
-							Optimization="0"
-							BasicRuntimeChecks="3"
-							AllOptions="/c  /ZI /nologo /W3 /Od /D &quot;USE_TAGGING&quot; /Gm /EHsc /RTC1 /MDd /YX&quot;StdAfx.h&quot; /Fp&quot;.\Debug/mp4ff.pch&quot; /Fo&quot;.\Debug/&quot; /Fd&quot;.\Debug/&quot; /Gd /TC"
-							MSOriginalAdditionalOptions=""/>
-					</Tool>
+					<Tool 
+						Name="VCCLCompilerTool"
+						AdditionalOptions=""
+						Optimization="0"
+						PreprocessorDefinitions=""
+						BasicRuntimeChecks="3"/>
 				</FileConfiguration>
 			</File>
-			<File
+			<File 
 				RelativePath="mp4ff.c">
-				<FileConfiguration
+				<FileConfiguration 
 					Name="Release|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="1"
-						PreprocessorDefinitions=""
-						AdditionalOptions="">
-						<IntelOptions
-							Optimization="1"
-							AllOptions="/c  /nologo /W3 /O1 /Ob1 /Oy /D &quot;USE_TAGGING&quot; /GF /FD /EHsc /MT /GS /Gy /YX&quot;StdAfx.h&quot; /Fp&quot;.\Release/mp4ff.pch&quot; /Fo&quot;.\Release/&quot; /Fd&quot;.\Release/&quot; /Gd /TC"
-							MSOriginalAdditionalOptions=""/>
-					</Tool>
+					<Tool 
+						Name="VCCLCompilerTool"
+						AdditionalOptions=""
+						Optimization="1"
+						PreprocessorDefinitions=""/>
 				</FileConfiguration>
-				<FileConfiguration
+				<FileConfiguration 
 					Name="Debug|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="0"
-						PreprocessorDefinitions=""
-						BasicRuntimeChecks="3"
-						AdditionalOptions="">
-						<IntelOptions
-							Optimization="0"
-							BasicRuntimeChecks="3"
-							AllOptions="/c  /ZI /nologo /W3 /Od /D &quot;USE_TAGGING&quot; /Gm /EHsc /RTC1 /MDd /YX&quot;StdAfx.h&quot; /Fp&quot;.\Debug/mp4ff.pch&quot; /Fo&quot;.\Debug/&quot; /Fd&quot;.\Debug/&quot; /Gd /TC"
-							MSOriginalAdditionalOptions=""/>
-					</Tool>
+					<Tool 
+						Name="VCCLCompilerTool"
+						AdditionalOptions=""
+						Optimization="0"
+						PreprocessorDefinitions=""
+						BasicRuntimeChecks="3"/>
 				</FileConfiguration>
 			</File>
-			<File
+			<File 
 				RelativePath="mp4meta.c">
-				<FileConfiguration
+				<FileConfiguration 
 					Name="Release|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="1"
-						PreprocessorDefinitions=""
-						AdditionalOptions="">
-						<IntelOptions
-							Optimization="1"
-							AllOptions="/c  /nologo /W3 /O1 /Ob1 /Oy /D &quot;USE_TAGGING&quot; /GF /FD /EHsc /MT /GS /Gy /YX&quot;StdAfx.h&quot; /Fp&quot;.\Release/mp4ff.pch&quot; /Fo&quot;.\Release/&quot; /Fd&quot;.\Release/&quot; /Gd /TC"
-							MSOriginalAdditionalOptions=""/>
-					</Tool>
+					<Tool 
+						Name="VCCLCompilerTool"
+						AdditionalOptions=""
+						Optimization="1"
+						PreprocessorDefinitions=""/>
 				</FileConfiguration>
-				<FileConfiguration
+				<FileConfiguration 
 					Name="Debug|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="0"
-						PreprocessorDefinitions=""
-						BasicRuntimeChecks="3"
-						AdditionalOptions="">
-						<IntelOptions
-							Optimization="0"
-							BasicRuntimeChecks="3"
-							AllOptions="/c  /ZI /nologo /W3 /Od /D &quot;USE_TAGGING&quot; /Gm /EHsc /RTC1 /MDd /YX&quot;StdAfx.h&quot; /Fp&quot;.\Debug/mp4ff.pch&quot; /Fo&quot;.\Debug/&quot; /Fd&quot;.\Debug/&quot; /Gd /TC"
-							MSOriginalAdditionalOptions=""/>
-					</Tool>
+					<Tool 
+						Name="VCCLCompilerTool"
+						AdditionalOptions=""
+						Optimization="0"
+						PreprocessorDefinitions=""
+						BasicRuntimeChecks="3"/>
 				</FileConfiguration>
 			</File>
-			<File
+			<File 
 				RelativePath="mp4sample.c">
-				<FileConfiguration
+				<FileConfiguration 
 					Name="Release|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="1"
-						PreprocessorDefinitions=""
-						AdditionalOptions="">
-						<IntelOptions
-							Optimization="1"
-							AllOptions="/c  /nologo /W3 /O1 /Ob1 /Oy /D &quot;USE_TAGGING&quot; /GF /FD /EHsc /MT /GS /Gy /YX&quot;StdAfx.h&quot; /Fp&quot;.\Release/mp4ff.pch&quot; /Fo&quot;.\Release/&quot; /Fd&quot;.\Release/&quot; /Gd /TC"
-							MSOriginalAdditionalOptions=""/>
-					</Tool>
+					<Tool 
+						Name="VCCLCompilerTool"
+						AdditionalOptions=""
+						Optimization="1"
+						PreprocessorDefinitions=""/>
 				</FileConfiguration>
-				<FileConfiguration
+				<FileConfiguration 
 					Name="Debug|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="0"
-						PreprocessorDefinitions=""
-						BasicRuntimeChecks="3"
-						AdditionalOptions="">
-						<IntelOptions
-							Optimization="0"
-							BasicRuntimeChecks="3"
-							AllOptions="/c  /ZI /nologo /W3 /Od /D &quot;USE_TAGGING&quot; /Gm /EHsc /RTC1 /MDd /YX&quot;StdAfx.h&quot; /Fp&quot;.\Debug/mp4ff.pch&quot; /Fo&quot;.\Debug/&quot; /Fd&quot;.\Debug/&quot; /Gd /TC"
-							MSOriginalAdditionalOptions=""/>
-					</Tool>
+					<Tool 
+						Name="VCCLCompilerTool"
+						AdditionalOptions=""
+						Optimization="0"
+						PreprocessorDefinitions=""
+						BasicRuntimeChecks="3"/>
 				</FileConfiguration>
 			</File>
-			<File
+			<File 
+				RelativePath=".\mp4tagupdate.c">
+			</File>
+			<File 
 				RelativePath="mp4util.c">
-				<FileConfiguration
+				<FileConfiguration 
 					Name="Release|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="1"
-						PreprocessorDefinitions=""
-						AdditionalOptions="">
-						<IntelOptions
-							Optimization="1"
-							AllOptions="/c  /nologo /W3 /O1 /Ob1 /Oy /D &quot;USE_TAGGING&quot; /GF /FD /EHsc /MT /GS /Gy /YX&quot;StdAfx.h&quot; /Fp&quot;.\Release/mp4ff.pch&quot; /Fo&quot;.\Release/&quot; /Fd&quot;.\Release/&quot; /Gd /TC"
-							MSOriginalAdditionalOptions=""/>
-					</Tool>
+					<Tool 
+						Name="VCCLCompilerTool"
+						AdditionalOptions=""
+						Optimization="1"
+						PreprocessorDefinitions=""/>
 				</FileConfiguration>
-				<FileConfiguration
+				<FileConfiguration 
 					Name="Debug|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="0"
-						PreprocessorDefinitions=""
-						BasicRuntimeChecks="3"
-						AdditionalOptions="">
-						<IntelOptions
-							Optimization="0"
-							BasicRuntimeChecks="3"
-							AllOptions="/c  /ZI /nologo /W3 /Od /D &quot;USE_TAGGING&quot; /Gm /EHsc /RTC1 /MDd /YX&quot;StdAfx.h&quot; /Fp&quot;.\Debug/mp4ff.pch&quot; /Fo&quot;.\Debug/&quot; /Fd&quot;.\Debug/&quot; /Gd /TC"
-							MSOriginalAdditionalOptions=""/>
-					</Tool>
+					<Tool 
+						Name="VCCLCompilerTool"
+						AdditionalOptions=""
+						Optimization="0"
+						PreprocessorDefinitions=""
+						BasicRuntimeChecks="3"/>
 				</FileConfiguration>
 			</File>
 		</Filter>
-		<Filter
-			Name="Header Files"
+		<Filter 
+			Name="Header Files"
 			Filter="h;hpp;hxx;hm;inl">
-			<File
-				RelativePath="mp4ffint.h"/>
+			<File 
+				RelativePath="mp4ffint.h">
+			</File>
 		</Filter>
 	</Files>
-	<Globals/>
+	<Globals>
+	</Globals>
 </VisualStudioProject>