shithub: aacenc

Download patch

ref: ad8538d9827f94c0fa7c0811b9db0c214be0fbd4
parent: 32fc4bbe5cbe0ab0ef948d0f5a77b2f010e793b0
author: menno <menno>
date: Tue Apr 3 05:13:47 EDT 2001

ADTS layer fixed for MPEG-4

--- a/libfaac/bitstream.c
+++ b/libfaac/bitstream.c
@@ -16,7 +16,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- * $Id: bitstream.c,v 1.8 2001/03/19 20:53:46 menno Exp $
+ * $Id: bitstream.c,v 1.9 2001/04/03 09:13:47 menno Exp $
  */
 
 #include <stdlib.h>
@@ -181,7 +181,11 @@
 		/* Fixed ADTS header */
 		PutBit(bitStream, 0xFFFF, 12); /* 12 bit Syncword */
 		PutBit(bitStream, 1, 1); /* ID */
-		PutBit(bitStream, 0, 2); /* layer */
+#ifdef MPEG2AAC
+		PutBit(bitStream, 0, 2); /* layer == 0 for MPEG2 AAC */
+#else
+		PutBit(bitStream, 4, 2); /* layer == 4 for MPEG4 AAC */
+#endif
 		PutBit(bitStream, 1, 1); /* protection absent */
 		PutBit(bitStream, hEncoder->config.aacProfile, 2); /* profile */
 		PutBit(bitStream, hEncoder->sampleRateIdx, 4); /* sampling rate */