shithub: aacenc

Download patch

ref: d87e1ccc519acd2d70f277982f9f03fa5b96048d
parent: 92ce34cb691da3330ef466f33784ce49a30b3b0f
author: lenox <lenox>
date: Wed Feb 23 11:41:10 EST 2000

fixed wildcards processing

--- a/encoder.c
+++ b/encoder.c
@@ -113,7 +113,6 @@
       return -4;
   }
 
-  as->bit_rate*=1000;
   if((as->bit_rate % 1000)||(as->bit_rate < 16000))
     return -5;
   if (as->channels != 2)
@@ -367,7 +366,7 @@
   as->use_LTP = 1;
   as->use_PNS = 0;
   as->cut_off = 0;
-  as->bit_rate = 128;
+  as->bit_rate = 128000;
   as->out_sampling_rate = 0;
   as->raw_audio = 0;
 }
@@ -388,7 +387,7 @@
       as->use_IS = value;
       break;
     case BITRATE:
-      as->bit_rate = value;
+      as->bit_rate = value*1000;
       break;
     case CUT_OFF:
       as->cut_off = value;
--- a/faac.c
+++ b/faac.c
@@ -120,6 +120,7 @@
 	  if (INVALID_HANDLE_VALUE != (hFindFile = FindFirstFile(argp, &fd))) {
 	     do {
 	       InFileNames[FileCount] = (char*) malloc((strlen(fd.cFileName) + strlen(path) + 2)*sizeof(char));
+	       OutFileNames[FileCount] = (char*) malloc((strlen(fd.cFileName) + strlen(path) + 2)*sizeof(char));
                strcat(strcpy(InFileNames[FileCount], path), fd.cFileName);
 	       FileCount++;
              }
@@ -220,7 +221,7 @@
   printf("AAC configuration:\n");
   printf("----------------------------------------------\n");
   printf("AAC profile: %s.\n", (as->profile==MAIN_PROFILE)?"MAIN":"LOW");
-  printf("Bitrate: %dkbps.\n", as->bit_rate);
+  printf("Bitrate: %dkbps.\n", as->bit_rate/1000);
   printf("Mid/Side (MS) stereo coding: %s.\n",
  	(as->use_MS==1)?"Always":((as->use_MS==0)?"Switching":"Off"));
   printf("Intensity stereo (IS) coding: %s.\n", as->use_IS?"On":"Off");
@@ -242,18 +243,18 @@
 
 int main(int argc, char *argv[])
 {
-  int						i, frames, currentFrame, result, FileCount;
-  char					*InFileNames[100], *OutFileNames[100];
+  int i, frames, currentFrame, result, FileCount;
+  char *InFileNames[100], *OutFileNames[100];
   faacAACStream *as;
 
 	/* System dependant types */
 #ifdef WIN32
   long	begin, end;
-  int		nTotSecs, nSecs;
-  int		nMins;
+  int nTotSecs, nSecs;
+  int nMins;
 #else
-	float	totalSecs;
-	int		mins;
+  float	totalSecs;
+  int mins;
 #endif
 
   /* create main aacstream object */
@@ -303,10 +304,9 @@
     nSecs = nTotSecs - (60*nMins);
     printf("Encoding %s took:\t%d:%.2d\t\n", InFileNames[i], nMins, nSecs);
 #else
-		totalSecs = (float)(clock())/(float)CLOCKS_PER_SEC;
-		mins = totalSecs/60;
-		printf("Encoding %s took: %i min, %.2f sec.\n", InFileNames[i],
-			mins, totalSecs - (60 * mins));
+    totalSecs = (float)(clock())/(float)CLOCKS_PER_SEC;
+    mins = totalSecs/60;
+    printf("Encoding %s took: %i min, %.2f sec.\n", InFileNames[i], mins, totalSecs - (60 * mins));
 #endif
     if(InFileNames[i]) free(InFileNames[i]);
     if(OutFileNames[i]) free(OutFileNames[i]);