shithub: aacdec

Download patch

ref: 5055d746ffa9134f432901122c73d13dbb6596dc
parent: 42ce0306d62d795bb9ead55d71c1ae418657d048
author: menno <menno>
date: Mon Oct 20 10:05:39 EDT 2003

fixes in mp4ff

--- a/common/mp4ff/esds.c
+++ b/common/mp4ff/esds.c
@@ -82,7 +82,7 @@
 
 int mp4ff_read_esds(mp4ff_t *file, mp4ff_esds_t *esds)
 {
-	unsigned __int8 tag;
+	uint8_t tag;
 
 	esds->version = mp4ff_read_char(file);
 	esds->flags = mp4ff_read_int24(file);
@@ -145,7 +145,7 @@
 
 	mp4ff_write_char(file, 0x03);	/* ES_DescrTag */
 	mp4ff_write_mp4_descr_length(file, 
-		3 + (5 + (13 + (5 + esds->decoderConfigLen))) + 3, FALSE);
+		3 + (5 + (13 + (5 + esds->decoderConfigLen))) + 3, /*FALSE*/0);
 
 	mp4ff_write_int16(file, esid);
 	mp4ff_write_char(file, 0x10);	/* streamPriorty = 16 (0-31) */
@@ -153,7 +153,7 @@
 	/* DecoderConfigDescriptor */
 	mp4ff_write_char(file, 0x04);	/* DecoderConfigDescrTag */
 	mp4ff_write_mp4_descr_length(file, 
-		13 + (5 + esds->decoderConfigLen), FALSE);
+		13 + (5 + esds->decoderConfigLen), 0 /*FALSE*/);
 
 	mp4ff_write_char(file, objectType); /* objectTypeIndication */
 	mp4ff_write_char(file, streamType); /* streamType */
@@ -163,7 +163,7 @@
 	mp4ff_write_int32(file, 0);		/* average bitrate */
 
 	mp4ff_write_char(file, 0x05);	/* DecSpecificInfoTag */
-	mp4ff_write_mp4_descr_length(file, esds->decoderConfigLen, FALSE);
+	mp4ff_write_mp4_descr_length(file, esds->decoderConfigLen, 0 /*FALSE*/);
 	mp4ff_write_data(file, esds->decoderConfig, esds->decoderConfigLen);
 
 	/* SLConfigDescriptor */
--- a/common/mp4ff/mp4ff.h
+++ b/common/mp4ff/mp4ff.h
@@ -5,8 +5,6 @@
 extern "C" {
 #endif
 
-#include <windows.h>
-
 #include <stdio.h>
 #include <stdlib.h>
 
--- a/common/mp4ff/private.h
+++ b/common/mp4ff/private.h
@@ -7,6 +7,12 @@
 #define MAXTRACKS 1024
 
 #ifdef _WIN32
+typedef __int8 int8_t;
+typedef unsigned __int8 uint8_t;
+typedef __int16 int16_t;
+typedef unsigned __int16 uint16_t;
+typedef __int32 int32_t;
+typedef unsigned __int32 uint32_t;
 typedef __int64 int64_t;
 typedef unsigned __int64 uint64_t;
 #else
@@ -16,6 +22,9 @@
 #ifdef HAVE_STDINT_H
 #include <stdint.h>
 #endif
+#define u_int8_t uint8_t
+#define u_int16_t uint16_t
+#define u_int32_t uint32_t
 #define u_int64_t uint64_t
 #endif
 
--- a/common/mp4ff/tkhd.c
+++ b/common/mp4ff/tkhd.c
@@ -19,8 +19,8 @@
 	mp4ff_matrix_init(&(tkhd->matrix));
 	tkhd->track_width = 0;
 	tkhd->track_height = 0;
-	tkhd->is_audio = FALSE;
-	tkhd->is_video = FALSE;
+	tkhd->is_audio = 0 /*FALSE*/;
+	tkhd->is_video = 0 /*FALSE*/;
 	return 0;
 }
 
@@ -27,7 +27,7 @@
 int mp4ff_tkhd_init_audio(mp4ff_t *file, 
 								mp4ff_tkhd_t *tkhd)
 {
-	tkhd->is_audio = TRUE;
+	tkhd->is_audio = 1 /*TRUE*/;
 }
 
 int mp4ff_tkhd_init_video(mp4ff_t *file, 
@@ -35,7 +35,7 @@
 								int frame_w, 
 								int frame_h)
 {
-	tkhd->is_video = TRUE;
+	tkhd->is_video = 1 /*TRUE*/;
 	tkhd->track_width = frame_w;
 	tkhd->track_height = frame_h;
 	tkhd->volume = 0;
--- a/common/mp4ff/util.c
+++ b/common/mp4ff/util.c
@@ -293,9 +293,9 @@
 
 int mp4ff_read_mp4_descr_length(mp4ff_t *file)
 {
-	unsigned __int8 b;
-	unsigned __int8 numBytes = 0;
-	unsigned __int32 length = 0;
+	uint8_t b;
+	uint8_t numBytes = 0;
+	uint32_t length = 0;
 
 	do {
 		b = mp4ff_read_char(file);
@@ -308,9 +308,9 @@
 
 int mp4ff_write_mp4_descr_length(mp4ff_t *file, int length, unsigned char compact)
 {
-	unsigned __int8 b;
-	__int8 i;
-	__int8 numBytes;
+	uint8_t b;
+	int8_t i;
+	int8_t numBytes;
 
 	if (compact) {
 		if (length <= 0x7F) {
@@ -346,7 +346,7 @@
 	mp4ff_set_position(file, atom->start);
 	printf("atom hex dump:\n");
 	for (i = 0; i < atom->size; i++) {
-		printf("%02x ", (unsigned __int8)mp4ff_read_char(file));
+		printf("%02x ", (uint8_t)mp4ff_read_char(file));
 		if ((i % 16) == 0 && i > 0) {
 			printf("\n");
 		}