shithub: aacenc

Download patch

ref: e6a55f8c9dc4510dea962e551628c501f8b38b6a
parent: 2d367d24a8b6a9af6c7593d414f798e9af3271a8
author: danchr <danchr>
date: Wed Mar 24 06:00:40 EST 2004

silence a few warnings and fix a few mem. leaks
make it possible to disable stripping (needed for profiling and debugging)

--- a/configure.in
+++ b/configure.in
@@ -7,6 +7,8 @@
 AC_DEFUN(MY_DEFINE, [ AC_DEFINE($1, 1, [define if needed]) ])
 
 CFLAGS=${CFLAGS:-"-O2 -Wall"}
+LDFLAGS=${LDFLAGS:-"-s"}
+
 AC_PROG_CC
 AM_PROG_LIBTOOL
 
--- a/frontend/Makefile.am
+++ b/frontend/Makefile.am
@@ -3,6 +3,5 @@
 faac_SOURCES = main.c input.c
 
 INCLUDES = -I$(top_srcdir)/include 
-LDFLAGS = -s
 LDADD = $(top_builddir)/libfaac/libfaac.la -lm
 
--- a/frontend/main.c
+++ b/frontend/main.c
@@ -18,7 +18,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: main.c,v 1.57 2004/03/17 13:32:13 danchr Exp $
+ * $Id: main.c,v 1.58 2004/03/24 11:00:40 danchr Exp $
  */
 
 #ifdef _MSC_VER
@@ -182,7 +182,7 @@
 
     int shortctl = SHORTCTL_NORMAL;
 
-    FILE *outfile;
+    FILE *outfile = NULL;
 
 #ifdef HAVE_LIBMP4V2
     MP4FileHandle MP4hFile = MP4_INVALID_FILE_HANDLE;
@@ -575,8 +575,8 @@
 #ifdef HAVE_LIBMP4V2
     /* initialize MP4 creation */
     if (container == MP4_CONTAINER) {
-        u_int8_t *ASC = 0;
-        u_int32_t ASCLength = 0;
+        unsigned char *ASC = 0;
+        unsigned long ASCLength = 0;
 	char *version_string;
 
         MP4hFile = MP4Create(aacFileName, 0, 0, 0);
@@ -590,6 +590,7 @@
         MP4SetAudioProfileLevel(MP4hFile, 0x0F);
         faacEncGetDecoderSpecificInfo(hEncoder, &ASC, &ASCLength);
         MP4SetTrackESConfiguration(MP4hFile, MP4track, ASC, ASCLength);
+	free(ASC);
 
 	/* set metadata */
 	version_string = malloc(strlen(faac_id_string) + 6);
@@ -602,7 +603,7 @@
 	if (title) MP4SetMetadataName(MP4hFile, title);
 	if (album) MP4SetMetadataAlbum(MP4hFile, album);
 	if (trackno > 0) MP4SetMetadataTrack(MP4hFile, trackno, ntracks);
-	if (date > 0) MP4SetMetadataYear(MP4hFile, date);
+	if (date) MP4SetMetadataYear(MP4hFile, date);
 	if (genre) MP4SetMetadataGenre(MP4hFile, genre);
 	if (comment) MP4SetMetadataComment(MP4hFile, genre);
     }
@@ -828,6 +829,10 @@
 
 /*
 $Log: main.c,v $
+Revision 1.58  2004/03/24 11:00:40  danchr
+silence a few warnings and fix a few mem. leaks
+make it possible to disable stripping (needed for profiling and debugging)
+
 Revision 1.57  2004/03/17 13:32:13  danchr
 - New signal handler. Disabled on Windows, although it *should* work.
 - Separated handling of stream format and output format.