shithub: aacenc

Download patch

ref: ff454b8a5268b309e15dc372ebd24166f36865f5
parent: 45202c7ffc018be67a8efa475093d20474b56ea0
author: knik <knik>
date: Mon Nov 24 13:10:32 EST 2003

A safe version of faacEncGetVersion() without string length problem.

--- a/include/faac.h
+++ b/include/faac.h
@@ -16,31 +16,33 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- * $Id: faac.h,v 1.31 2003/11/15 08:13:41 stux Exp $
+ * $Id: faac.h,v 1.32 2003/11/24 18:10:32 knik Exp $
  */
 
 #ifndef _FAAC_H_
 #define _FAAC_H_
+
 #ifdef __cplusplus
 extern "C" {
 #endif /* __cplusplus */
 
 #ifdef WIN32
-  #ifndef FAACAPI
-    #define FAACAPI __stdcall
-  #endif
+# ifndef FAACAPI
+#  define FAACAPI __stdcall
+# endif
 #else
-  #ifndef FAACAPI
-    #define FAACAPI
-  #endif
+# ifndef FAACAPI
+#  define FAACAPI
+# endif
 #endif
 
 #pragma pack(push, 1)
 
 typedef struct {
-	  void *ptr;
-	  char *name;
-} psymodellist_t;
+  void *ptr;
+  char *name;
+}
+psymodellist_t;
 
 #include "faaccfg.h"
 
@@ -49,45 +51,38 @@
 
 /*
 	Allows an application to get FAAC version info. This is intended
-	purely for informative purposes. 
-	
-	faac_version_string		:	if not NULL, will be "X.YY.Z"
-	faac_name_string		:	if not NULL, will be "X.YY.Z (DD/MM/YYYY)"
-	faac_copyright_string	:	if not NULL, will be the copyright string
+	purely for informative purposes.
 
-	RETURNS					:	Current FAAC_CFG_VERSION  (104)
+	Returns FAAC_CFG_VERSION.
 */
-int						FAACAPI faacEncGetVersion( char *faac_version_string, 
-										char *faac_name_string, 
-										char *faac_copyright_string );
+int FAACAPI faacEncGetVersion(char **faac_id_string,
+			      char **faac_copyright_string);
 
 
-faacEncConfigurationPtr	FAACAPI	faacEncGetCurrentConfiguration( faacEncHandle hEncoder );
+faacEncConfigurationPtr FAACAPI
+  faacEncGetCurrentConfiguration(faacEncHandle hEncoder);
 
 
-int						FAACAPI	faacEncSetConfiguration( faacEncHandle hEncoder, 
-										faacEncConfigurationPtr config );
+int FAACAPI faacEncSetConfiguration(faacEncHandle hEncoder,
+				    faacEncConfigurationPtr config);
 
 
-faacEncHandle			FAACAPI faacEncOpen( unsigned long sampleRate,
-										unsigned int numChannels,
-										unsigned long *inputSamples,
-										unsigned long *maxOutputBytes );
+faacEncHandle FAACAPI faacEncOpen(unsigned long sampleRate,
+				  unsigned int numChannels,
+				  unsigned long *inputSamples,
+				  unsigned long *maxOutputBytes);
 
 
-int						FAACAPI faacEncGetDecoderSpecificInfo( faacEncHandle hEncoder,
-										unsigned char** ppBuffer,
-										unsigned long* pSizeOfDecoderSpecificInfo );
+int FAACAPI faacEncGetDecoderSpecificInfo(faacEncHandle hEncoder, unsigned char **ppBuffer,
+					  unsigned long *pSizeOfDecoderSpecificInfo);
 
 
-int						FAACAPI faacEncEncode(faacEncHandle hEncoder,
-										int32_t *inputBuffer,
-										unsigned int samplesInput,
-										unsigned char *outputBuffer,
-										unsigned int bufferSize );
+int FAACAPI faacEncEncode(faacEncHandle hEncoder, int32_t * inputBuffer, unsigned int samplesInput,
+			 unsigned char *outputBuffer,
+			 unsigned int bufferSize);
 
 
-int						FAACAPI faacEncClose( faacEncHandle hEncoder );
+int FAACAPI faacEncClose(faacEncHandle hEncoder);
 
 
 
--- a/libfaac/frame.h
+++ b/libfaac/frame.h
@@ -16,7 +16,7 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- * $Id: frame.h,v 1.26 2003/11/16 05:02:52 stux Exp $
+ * $Id: frame.h,v 1.27 2003/11/24 18:09:38 knik Exp $
  */
 
 #ifndef FRAME_H
@@ -126,19 +126,8 @@
     int bitDiff;
 } faacEncStruct, *faacEncHandle;
 
-
-/*
-	Allows an application to get FAAC version info. This is intended
-	purely for informative purposes. 
-	
-	faac_version_string		:	if not NULL, will be "X.YY.Z"
-	faac_name_string		:	if not NULL, will be "X.YY.Z (DD/MM/YYYY)"
-	faac_copyright_string	:	if not NULL, will be the copyright string
-
-	RETURNS					:	Current FAAC_CFG_VERSION  (104)
-*/
-
-int FAACAPI faacEncGetVersion( char *faac_version_string, char *faac_name_string, char *faac_copyright_string );
+int FAACAPI faacEncGetVersion(char **faac_id_string,
+			      char **faac_copyright_string);
 
 int FAACAPI faacEncGetDecoderSpecificInfo(faacEncHandle hEncoder,
                                           unsigned char** ppBuffer,