shithub: aacenc

Download patch

ref: cc0cd379c13d51b38eb0bd21d6496c42838b8835
parent: 2b5daa544020703f6a284dbcaf870d591e3c970c
author: menno <menno>
date: Fri Nov 1 06:20:14 EST 2002

Small changes to the decoder interface:
every function that has a buffer as input now also has a parameter to give the size of that buffer.

--- a/libfaac/libfaac.vcproj
+++ b/libfaac/libfaac.vcproj
@@ -67,7 +67,7 @@
 				OptimizeForProcessor="2"
 				PreprocessorDefinitions="WIN32,NDEBUG,_LIB"
 				StringPooling="TRUE"
-				RuntimeLibrary="4"
+				RuntimeLibrary="0"
 				EnableFunctionLevelLinking="TRUE"
 				UsePrecompiledHeader="2"
 				PrecompiledHeaderFile=".\Release/libfaac.pch"
--- a/plugins/cooledit/FAAC.vcproj
+++ b/plugins/cooledit/FAAC.vcproj
@@ -83,7 +83,7 @@
 				AdditionalIncludeDirectories="../../../faad2/common/faad,../../include,../../../faad2/include,../../../faad2/common/mp4v2"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;FAAC_EXPORTS"
 				StringPooling="TRUE"
-				RuntimeLibrary="4"
+				RuntimeLibrary="0"
 				EnableFunctionLevelLinking="TRUE"
 				UsePrecompiledHeader="2"
 				PrecompiledHeaderFile=".\Release/FAAC.pch"
--- a/plugins/cooledit/Faad.cpp
+++ b/plugins/cooledit/Faad.cpp
@@ -163,8 +163,8 @@
 
             if (buff)
             {
-                rc = AudioSpecificConfig(buff, &dummy1_32, &dummy2_8, &dummy3_8, &dummy4_8,
-                    &dummy5_8, &dummy6_8, &dummy7_8, &dummy8_8);
+                rc = AudioSpecificConfig(buff, buff_size, &dummy1_32, &dummy2_8, &dummy3_8,
+                    &dummy4_8, &dummy5_8, &dummy6_8, &dummy7_8, &dummy8_8);
                 free(buff);
 
                 if (rc < 0)
@@ -494,7 +494,7 @@
 		MP4GetTrackESConfiguration(mi->mp4File, track, (unsigned __int8 **)&mi->buffer, &buffer_size);
 	    if(!mi->buffer)
 			ERROR_OFI("MP4GetTrackESConfiguration");
-		AudioSpecificConfig(mi->buffer, &timeScale, &channels, &sf, &mi->type, &dummy8, &dummy8, &dummy8, &dummy8);
+		AudioSpecificConfig(mi->buffer, buffer_size, &timeScale, &channels, &sf, &mi->type, &dummy8, &dummy8, &dummy8, &dummy8);
 		if(faacDecInit2(mi->hDecoder, mi->buffer, buffer_size, &samplerate, &channels) < 0)
 			ERROR_OFI("Error initializing decoder library");
 	    FREE(mi->buffer);
@@ -618,7 +618,7 @@
 				DWORD	Samples,
 						BytesConsumed;
 
-					if((mi->bytes_consumed=faacDecInit(mi->hDecoder, mi->buffer, &samplerate, &channels)) < 0)
+					if((mi->bytes_consumed=faacDecInit(mi->hDecoder, mi->buffer, mi->bytes_into_buffer, &samplerate, &channels)) < 0)
 						ERROR_OFI("Can't init library");
 					mi->bytes_into_buffer-=mi->bytes_consumed;
 					if(!(Samples=ReadFilterInput(hInput,0,0)/sizeof(short)))
@@ -645,7 +645,7 @@
 				}
 			}
 
-		if((mi->bytes_consumed=faacDecInit(mi->hDecoder, mi->buffer, &samplerate, &channels)) < 0)
+		if((mi->bytes_consumed=faacDecInit(mi->hDecoder, mi->buffer, mi->bytes_into_buffer, &samplerate, &channels)) < 0)
 			ERROR_OFI("Can't init library");
 		mi->bytes_into_buffer-=mi->bytes_consumed;
 
@@ -734,7 +734,7 @@
 				ERROR_RFI("MP4ReadSample")
 			}
 
-			sample_buffer=(char *)faacDecDecode(mi->hDecoder,&frameInfo,buffer);
+			sample_buffer=(char *)faacDecDecode(mi->hDecoder,&frameInfo,buffer,buffer_size);
 			BytesDecoded=frameInfo.samples*sizeof(short);
 			memcpy(bufout,sample_buffer,BytesDecoded);
 			FREE(buffer);
@@ -776,7 +776,7 @@
 				else
 					ERROR_RFI(0)
 
-			sample_buffer=(char *)faacDecDecode(mi->hDecoder,&frameInfo,buffer);
+			sample_buffer=(char *)faacDecDecode(mi->hDecoder,&frameInfo,buffer,mi->bytes_into_buffer);
 			BytesDecoded=frameInfo.samples*sizeof(short);
 			if(bufout)
 				memcpy(bufout,sample_buffer,BytesDecoded);
--- a/plugins/cooledit/aacInfoLib.vcproj
+++ b/plugins/cooledit/aacInfoLib.vcproj
@@ -69,7 +69,7 @@
 				AdditionalIncludeDirectories="../../../faad2/common/faad"
 				PreprocessorDefinitions="WIN32,NDEBUG,_LIB"
 				StringPooling="TRUE"
-				RuntimeLibrary="4"
+				RuntimeLibrary="0"
 				EnableFunctionLevelLinking="TRUE"
 				UsePrecompiledHeader="2"
 				PrecompiledHeaderFile=".\Release/aacInfoLib.pch"