1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
|
diff -ur faad2/include/faad.h faad2-patch/include/faad.h
--- faad2/include/faad.h 2004-02-06 04:23:28.000000000 -0600
+++ faad2-patch/include/faad.h 2005-05-10 10:58:39.000000000 -0600
@@ -43,6 +43,10 @@
#endif
#endif
+/* needed for standard integer types */
+#define __STDC_LIMIT_MACROS
+#include <stdint.h>
+
#define FAAD2_VERSION "2.0 "
/* object types for AAC */
@@ -112,86 +116,86 @@
typedef struct mp4AudioSpecificConfig
{
/* Audio Specific Info */
- unsigned char objectTypeIndex;
- unsigned char samplingFrequencyIndex;
- unsigned long samplingFrequency;
- unsigned char channelsConfiguration;
+ uint8_t objectTypeIndex;
+ uint8_t samplingFrequencyIndex;
+ uint32_t samplingFrequency;
+ uint8_t channelsConfiguration;
/* GA Specific Info */
- unsigned char frameLengthFlag;
- unsigned char dependsOnCoreCoder;
- unsigned short coreCoderDelay;
- unsigned char extensionFlag;
- unsigned char aacSectionDataResilienceFlag;
- unsigned char aacScalefactorDataResilienceFlag;
- unsigned char aacSpectralDataResilienceFlag;
- unsigned char epConfig;
+ uint8_t frameLengthFlag;
+ uint8_t dependsOnCoreCoder;
+ uint16_t coreCoderDelay;
+ uint8_t extensionFlag;
+ uint8_t aacSectionDataResilienceFlag;
+ uint8_t aacScalefactorDataResilienceFlag;
+ uint8_t aacSpectralDataResilienceFlag;
+ uint8_t epConfig;
- char sbr_present_flag;
- char forceUpSampling;
+ int8_t sbr_present_flag;
+ int8_t forceUpSampling;
} mp4AudioSpecificConfig;
typedef struct faacDecConfiguration
{
- unsigned char defObjectType;
- unsigned long defSampleRate;
- unsigned char outputFormat;
- unsigned char downMatrix;
- unsigned char useOldADTSFormat;
- unsigned char dontUpSampleImplicitSBR;
+ uint8_t defObjectType;
+ uint8_t defSampleRate;
+ uint8_t outputFormat;
+ uint8_t downMatrix;
+ uint8_t useOldADTSFormat;
+ uint8_t dontUpSampleImplicitSBR;
} faacDecConfiguration, *faacDecConfigurationPtr;
typedef struct faacDecFrameInfo
{
- unsigned long bytesconsumed;
- unsigned long samples;
- unsigned char channels;
- unsigned char error;
- unsigned long samplerate;
+ uint32_t bytesconsumed;
+ uint32_t samples;
+ uint8_t channels;
+ uint8_t error;
+ uint32_t samplerate;
/* SBR: 0: off, 1: on; upsample, 2: on; downsampled, 3: off; upsampled */
- unsigned char sbr;
+ uint8_t sbr;
/* MPEG-4 ObjectType */
- unsigned char object_type;
+ uint8_t object_type;
/* AAC header type; MP4 will be signalled as RAW also */
- unsigned char header_type;
+ uint8_t header_type;
/* multichannel configuration */
- unsigned char num_front_channels;
- unsigned char num_side_channels;
- unsigned char num_back_channels;
- unsigned char num_lfe_channels;
- unsigned char channel_position[64];
+ uint8_t num_front_channels;
+ uint8_t num_side_channels;
+ uint8_t num_back_channels;
+ uint8_t num_lfe_channels;
+ uint8_t channel_position[64];
} faacDecFrameInfo;
-char* FAADAPI faacDecGetErrorMessage(unsigned char errcode);
+int8_t* FAADAPI faacDecGetErrorMessage(uint8_t errcode);
-unsigned long FAADAPI faacDecGetCapabilities(void);
+uint32_t FAADAPI faacDecGetCapabilities(void);
faacDecHandle FAADAPI faacDecOpen(void);
faacDecConfigurationPtr FAADAPI faacDecGetCurrentConfiguration(faacDecHandle hDecoder);
-unsigned char FAADAPI faacDecSetConfiguration(faacDecHandle hDecoder,
+uint8_t FAADAPI faacDecSetConfiguration(faacDecHandle hDecoder,
faacDecConfigurationPtr config);
/* Init the library based on info from the AAC file (ADTS/ADIF) */
long FAADAPI faacDecInit(faacDecHandle hDecoder,
- unsigned char *buffer,
- unsigned long buffer_size,
- unsigned long *samplerate,
- unsigned char *channels);
+ uint8_t *buffer,
+ uint32_t buffer_size,
+ uint32_t *samplerate,
+ uint8_t *channels);
/* Init the library using a DecoderSpecificInfo */
-char FAADAPI faacDecInit2(faacDecHandle hDecoder, unsigned char *pBuffer,
- unsigned long SizeOfDecoderSpecificInfo,
- unsigned long *samplerate, unsigned char *channels);
+int8_t FAADAPI faacDecInit2(faacDecHandle hDecoder, uint8_t *pBuffer,
+ uint32_t SizeOfDecoderSpecificInfo,
+ uint32_t *samplerate, uint8_t *channels);
/* Init the library for DRM */
-char FAADAPI faacDecInitDRM(faacDecHandle hDecoder, unsigned long samplerate,
- unsigned char channels);
+int8_t FAADAPI faacDecInitDRM(faacDecHandle hDecoder, uint32_t samplerate,
+ uint8_t channels);
void FAADAPI faacDecPostSeekReset(faacDecHandle hDecoder, long frame);
@@ -199,12 +203,12 @@
void* FAADAPI faacDecDecode(faacDecHandle hDecoder,
faacDecFrameInfo *hInfo,
- unsigned char *buffer,
- unsigned long buffer_size);
+ uint8_t *buffer,
+ uint32_t buffer_size);
-char FAADAPI AudioSpecificConfig(unsigned char *pBuffer,
- unsigned long buffer_size,
- mp4AudioSpecificConfig *mp4ASC);
+int8_t FAADAPI AudioSpecificConfig(uint8_t *pBuffer,
+ uint32_t buffer_size,
+ mp4AudioSpecificConfig *mp4ASC);
#ifdef _WIN32
#pragma pack(pop)
diff -ur faad2/libfaad/common.h faad2-patch/libfaad/common.h
--- faad2/libfaad/common.h 2004-02-06 06:55:24.000000000 -0600
+++ faad2-patch/libfaad/common.h 2005-05-10 10:45:41.000000000 -0600
@@ -197,8 +197,16 @@
#else
# if HAVE_STDINT_H
# include <stdint.h>
-# else
-/* we need these... */
+# elif defined(__x86_64__)
+typedef unsigned long uint64_t;
+typedef unsigned int uint32_t;
+typedef unsigned short uint16_t;
+typedef unsigned char uint8_t;
+typedef long int64_t;
+typedef int int32_t;
+typedef short int16_t;
+typedef char int8_t;
+#else
typedef unsigned long long uint64_t;
typedef unsigned long uint32_t;
typedef unsigned short uint16_t;
diff -ur faad2/plugins/mpeg4ip/aa_file.cpp faad2-patch/plugins/mpeg4ip/aa_file.cpp
--- faad2/plugins/mpeg4ip/aa_file.cpp 2004-01-05 08:05:12.000000000 -0600
+++ faad2-patch/plugins/mpeg4ip/aa_file.cpp 2005-05-10 10:58:04.000000000 -0600
@@ -56,8 +56,8 @@
aac->m_buffer_size_max,
aac->m_ifile);
- unsigned long freq;
- unsigned char chans;
+ uint32_t freq;
+ uint8_t chans;
faacDecInit(aac->m_info, (unsigned char *)aac->m_buffer,
aac->m_buffer_size, &freq, &chans);
diff -ur faad2/plugins/mpeg4ip/faad2.cpp faad2-patch/plugins/mpeg4ip/faad2.cpp
--- faad2/plugins/mpeg4ip/faad2.cpp 2004-01-05 08:05:12.000000000 -0600
+++ faad2-patch/plugins/mpeg4ip/faad2.cpp 2005-05-10 10:54:29.000000000 -0600
@@ -76,8 +76,8 @@
}
aac->m_info = faacDecOpen();
- unsigned long srate;
- unsigned char chan;
+ uint32_t srate;
+ uint8_t chan;
if ((userdata == NULL && fmtp == NULL) ||
(faacDecInit2(aac->m_info,
(uint8_t *)userdata,
@@ -156,7 +156,7 @@
void *userdata)
{
aac_codec_t *aac = (aac_codec_t *)ptr;
- unsigned long bytes_consummed;
+ uint32_t bytes_consummed;
int bits = -1;
// struct timezone tz;
@@ -188,8 +188,8 @@
* If not initialized, do so.
*/
abort();
- unsigned long freq;
- unsigned char chans;
+ uint32_t freq;
+ uint8_t chans;
faacDecInit(aac->m_info,
(unsigned char *)buffer,
@@ -202,7 +202,7 @@
}
uint8_t *buff;
- unsigned long samples;
+ uint32_t samples;
bytes_consummed = buflen;
//aa_message(LOG_DEBUG, aaclib, "decoding %d bits", buflen * 8);
faacDecFrameInfo frame_info;
@@ -237,7 +237,7 @@
aac->m_vft->audio_configure(aac->m_ifptr,
aac->m_freq,
aac->m_chans,
- AUDIO_S16SYS,
+ AUDIO_FMT_S16,
aac->m_output_frame_size);
uint8_t *now = aac->m_vft->audio_get_buffer(aac->m_ifptr);
aac->m_audio_inited = 1;
diff -ur faad2/plugins/xmms/src/libmp4.c faad2-patch/plugins/xmms/src/libmp4.c
--- faad2/plugins/xmms/src/libmp4.c 2005-05-10 11:02:04.000000000 -0600
+++ faad2-patch/plugins/xmms/src/libmp4.c 2005-05-10 10:57:36.000000000 -0600
@@ -22,6 +22,9 @@
#define MP4_ABOUT "Written by ciberfred"
#define BUFFER_SIZE FAAD_MIN_STREAMSIZE*64
+extern void getMP4info(char* file);
+extern int getAACTrack(MP4FileHandle file);
+
static void mp4_init(void);
static void mp4_about(void);
static void mp4_play(char *);
@@ -116,14 +119,12 @@
extention = strrchr(filename, '.');
- if (extention &&
- (!strcasecmp(extention, ".mp4") || // official extention
- !strcasecmp(extention, ".m4a") || // Apple mp4 extention
- !strcasecmp(extention, ".aac") // old MPEG2/4-AAC extention
+ if (extention)
+ if( (!strcasecmp(extention, ".mp4") || // official extention
+ !strcasecmp(extention, ".m4a") || // Apple mp4 extention
+ !strcasecmp(extention, ".aac") // old MPEG2/4-AAC extention
))
- {
- return (1);
- }
+ return (1);
}
return(0);
}
|