shithub: aacenc

Download patch

ref: 3e883f8902419cf333aaabd0caa117cff6e9b9d7
parent: f5a6ef57b3baa4c671defdc987bc0aa583251c58
author: lenox <lenox>
date: Mon Feb 7 03:24:40 EST 2000

some cleanup

--- a/encoder.c
+++ b/encoder.c
@@ -113,7 +113,7 @@
 {
 	int i, j, error;
 	int usedNumBit, usedBytes;
-	int savedSamplesOut, samplesOut, curSample = 0;
+	int samplesOut, curSample = 0;
 	BsBitStream *bitBuf;
 	float *dataOut;
 	float *data = NULL;
@@ -126,7 +126,7 @@
 	}
 
 	if (as->rc_needed && (Samples > 0)) {
-		savedSamplesOut = samplesOut = as->savedSize + RateConv (
+		samplesOut = as->savedSize + RateConv (
 			as->rc_buf,			/* in: buffer (handle) */
 			Buffer,		/* in: input data[] */
 			as->samplesToRead,		/* in: number of input samples */
@@ -424,7 +424,7 @@
 	int readNumSample;
 
 	short *sampleBuffer;
-	unsigned char *bitBuffer = NULL;
+	unsigned char *bitBuffer;
 	FILE *aacfile;
 	SNDFILE *sndfile;
 	SF_INFO sf_info;
@@ -455,7 +455,6 @@
 	int nTotSecs, nSecs;
 	int nMins;
 
-	faacv = NULL;
 	faacv = faacEncodeVersion();
 	printf("FAAC cl (Freeware AAC Encoder)\n");
 	printf("FAAC homepage: %s\n", faacv->HomePage);
@@ -704,9 +703,8 @@
 		}
 
 		fclose(aacfile);
-		if (bitBuffer) { free(bitBuffer); bitBuffer = NULL; }
-		if (sampleBuffer) { free(sampleBuffer); sampleBuffer = NULL; }
-
+		if (bitBuffer)  free(bitBuffer);
+		if (sampleBuffer)  free(sampleBuffer);
 #ifdef WIN32
 		end = GetTickCount();
 #else