Contents of /trunk/libfaad2/patches/libfaad2-2.0-gcc4.patch
Parent Directory | Revision Log
Revision 144 -
(show annotations)
(download)
Tue May 8 20:06:05 2007 UTC (17 years, 4 months ago) by niro
File size: 14732 byte(s)
Tue May 8 20:06:05 2007 UTC (17 years, 4 months ago) by niro
File size: 14732 byte(s)
-import
1 | Index: faad2-2.0/common/mp4ff/mp4atom.c |
2 | =================================================================== |
3 | --- faad2-2.0.orig/common/mp4ff/mp4atom.c |
4 | +++ faad2-2.0/common/mp4ff/mp4atom.c |
5 | @@ -31,15 +31,15 @@ |
6 | #include "drms.h" |
7 | |
8 | /* parse atom header size */ |
9 | -static int32_t mp4ff_atom_get_size(const int8_t *data) |
10 | +static int32_t mp4ff_atom_get_size(const uint8_t *data) |
11 | { |
12 | uint32_t result; |
13 | uint32_t a, b, c, d; |
14 | |
15 | - a = (uint8_t)data[0]; |
16 | - b = (uint8_t)data[1]; |
17 | - c = (uint8_t)data[2]; |
18 | - d = (uint8_t)data[3]; |
19 | + a = data[0]; |
20 | + b = data[1]; |
21 | + c = data[2]; |
22 | + d = data[3]; |
23 | |
24 | result = (a<<24) | (b<<16) | (c<<8) | d; |
25 | //if (result > 0 && result < 8) result = 8; |
26 | @@ -182,7 +182,7 @@ uint64_t mp4ff_atom_read_header(mp4ff_t |
27 | { |
28 | uint64_t size; |
29 | int32_t ret; |
30 | - int8_t atom_header[8]; |
31 | + uint8_t atom_header[8]; |
32 | |
33 | ret = mp4ff_read_data(f, atom_header, 8); |
34 | if (ret != 8) |
35 | Index: faad2-2.0/common/mp4ff/mp4ff.h |
36 | =================================================================== |
37 | --- faad2-2.0.orig/common/mp4ff/mp4ff.h |
38 | +++ faad2-2.0/common/mp4ff/mp4ff.h |
39 | @@ -125,4 +125,4 @@ int32_t mp4ff_meta_update(mp4ff_callback |
40 | } |
41 | #endif /* __cplusplus */ |
42 | |
43 | -#endif |
44 | \ No newline at end of file |
45 | +#endif |
46 | Index: faad2-2.0/common/mp4ff/mp4ff_int_types.h |
47 | =================================================================== |
48 | --- faad2-2.0.orig/common/mp4ff/mp4ff_int_types.h |
49 | +++ faad2-2.0/common/mp4ff/mp4ff_int_types.h |
50 | @@ -20,4 +20,4 @@ typedef unsigned __int64 uint64_t; |
51 | #endif |
52 | |
53 | |
54 | -#endif |
55 | \ No newline at end of file |
56 | +#endif |
57 | Index: faad2-2.0/common/mp4ff/mp4ffint.h |
58 | =================================================================== |
59 | --- faad2-2.0.orig/common/mp4ff/mp4ffint.h |
60 | +++ faad2-2.0/common/mp4ff/mp4ffint.h |
61 | @@ -226,8 +226,8 @@ typedef struct |
62 | |
63 | |
64 | /* mp4util.c */ |
65 | -int32_t mp4ff_read_data(mp4ff_t *f, int8_t *data, uint32_t size); |
66 | -int32_t mp4ff_write_data(mp4ff_t *f, int8_t *data, uint32_t size); |
67 | +int32_t mp4ff_read_data(mp4ff_t *f, uint8_t *data, uint32_t size); |
68 | +int32_t mp4ff_write_data(mp4ff_t *f, uint8_t *data, uint32_t size); |
69 | uint64_t mp4ff_read_int64(mp4ff_t *f); |
70 | uint32_t mp4ff_read_int32(mp4ff_t *f); |
71 | uint32_t mp4ff_read_int24(mp4ff_t *f); |
72 | @@ -241,7 +241,7 @@ int32_t mp4ff_truncate(mp4ff_t * f); |
73 | char * mp4ff_read_string(mp4ff_t * f,uint32_t length); |
74 | |
75 | /* mp4atom.c */ |
76 | -static int32_t mp4ff_atom_get_size(const int8_t *data); |
77 | +static int32_t mp4ff_atom_get_size(const uint8_t *data); |
78 | static int32_t mp4ff_atom_compare(const int8_t a1, const int8_t b1, const int8_t c1, const int8_t d1, |
79 | const int8_t a2, const int8_t b2, const int8_t c2, const int8_t d2); |
80 | static uint8_t mp4ff_atom_name_to_type(const int8_t a, const int8_t b, const int8_t c, const int8_t d); |
81 | @@ -301,7 +301,6 @@ mp4ff_t *mp4ff_open_read(mp4ff_callback_ |
82 | mp4ff_t *mp4ff_open_edit(mp4ff_callback_t *f); |
83 | #endif |
84 | void mp4ff_close(mp4ff_t *ff); |
85 | -void mp4ff_track_add(mp4ff_t *f); |
86 | int32_t parse_sub_atoms(mp4ff_t *f, const uint64_t total_size); |
87 | int32_t parse_atoms(mp4ff_t *f); |
88 | |
89 | @@ -326,4 +325,4 @@ const char * mp4ff_meta_index_to_genre(u |
90 | } |
91 | #endif /* __cplusplus */ |
92 | |
93 | -#endif |
94 | \ No newline at end of file |
95 | +#endif |
96 | Index: faad2-2.0/common/mp4ff/mp4meta.c |
97 | =================================================================== |
98 | --- faad2-2.0.orig/common/mp4ff/mp4meta.c |
99 | +++ faad2-2.0/common/mp4ff/mp4meta.c |
100 | @@ -411,4 +411,4 @@ int32_t mp4ff_meta_get_coverart(const mp |
101 | return mp4ff_meta_find_by_name(f, "cover", value); |
102 | } |
103 | |
104 | -#endif |
105 | \ No newline at end of file |
106 | +#endif |
107 | Index: faad2-2.0/common/mp4ff/mp4tagupdate.c |
108 | =================================================================== |
109 | --- faad2-2.0.orig/common/mp4ff/mp4tagupdate.c |
110 | +++ faad2-2.0/common/mp4ff/mp4tagupdate.c |
111 | @@ -143,7 +143,7 @@ unsigned membuffer_transfer_from_file(me |
112 | bufptr = membuffer_get_ptr(buf); |
113 | if (bufptr==0) return 0; |
114 | |
115 | - if ((unsigned)mp4ff_read_data(src,(char*)bufptr + oldsize,bytes)!=bytes) |
116 | + if ((unsigned)mp4ff_read_data(src,(uint8_t*)bufptr + oldsize,bytes)!=bytes) |
117 | { |
118 | membuffer_set_error(buf); |
119 | return 0; |
120 | @@ -398,7 +398,7 @@ static uint32_t find_atom(mp4ff_t * f,ui |
121 | uint64_t atom_offset = base; |
122 | for(;;) |
123 | { |
124 | - char atom_name[4]; |
125 | + uint8_t atom_name[4]; |
126 | uint32_t atom_size; |
127 | |
128 | mp4ff_set_position(f,atom_offset); |
129 | @@ -618,7 +618,7 @@ int32_t mp4ff_meta_update(mp4ff_callback |
130 | /* copy moov atom to end of the file */ |
131 | if (ff->last_atom != ATOM_MOOV) |
132 | { |
133 | - char *free_data = "free"; |
134 | + uint8_t *free_data = (uint8_t*)"free"; |
135 | |
136 | /* rename old moov to free */ |
137 | mp4ff_set_position(ff, ff->moov_offset + 4); |
138 | @@ -626,14 +626,14 @@ int32_t mp4ff_meta_update(mp4ff_callback |
139 | |
140 | mp4ff_set_position(ff, ff->file_size); |
141 | mp4ff_write_int32(ff,new_moov_size + 8); |
142 | - mp4ff_write_data(ff,"moov",4); |
143 | + mp4ff_write_data(ff,(uint8_t*)"moov",4); |
144 | mp4ff_write_data(ff, new_moov_data, new_moov_size); |
145 | } |
146 | else |
147 | { |
148 | mp4ff_set_position(ff, ff->moov_offset); |
149 | mp4ff_write_int32(ff,new_moov_size + 8); |
150 | - mp4ff_write_data(ff,"moov",4); |
151 | + mp4ff_write_data(ff,(uint8_t*)"moov",4); |
152 | mp4ff_write_data(ff, new_moov_data, new_moov_size); |
153 | } |
154 | |
155 | Index: faad2-2.0/common/mp4ff/mp4util.c |
156 | =================================================================== |
157 | --- faad2-2.0.orig/common/mp4ff/mp4util.c |
158 | +++ faad2-2.0/common/mp4ff/mp4util.c |
159 | @@ -28,7 +28,7 @@ |
160 | #include "mp4ffint.h" |
161 | #include <stdlib.h> |
162 | |
163 | -int32_t mp4ff_read_data(mp4ff_t *f, int8_t *data, uint32_t size) |
164 | +int32_t mp4ff_read_data(mp4ff_t *f, uint8_t *data, uint32_t size) |
165 | { |
166 | int32_t result = 1; |
167 | |
168 | @@ -44,7 +44,7 @@ int32_t mp4ff_truncate(mp4ff_t * f) |
169 | return f->stream->truncate(f->stream->user_data); |
170 | } |
171 | |
172 | -int32_t mp4ff_write_data(mp4ff_t *f, int8_t *data, uint32_t size) |
173 | +int32_t mp4ff_write_data(mp4ff_t *f, uint8_t *data, uint32_t size) |
174 | { |
175 | int32_t result = 1; |
176 | |
177 | @@ -105,13 +105,13 @@ uint32_t mp4ff_read_int32(mp4ff_t *f) |
178 | { |
179 | uint32_t result; |
180 | uint32_t a, b, c, d; |
181 | - int8_t data[4]; |
182 | + uint8_t data[4]; |
183 | |
184 | mp4ff_read_data(f, data, 4); |
185 | - a = (uint8_t)data[0]; |
186 | - b = (uint8_t)data[1]; |
187 | - c = (uint8_t)data[2]; |
188 | - d = (uint8_t)data[3]; |
189 | + a = data[0]; |
190 | + b = data[1]; |
191 | + c = data[2]; |
192 | + d = data[3]; |
193 | |
194 | result = (a<<24) | (b<<16) | (c<<8) | d; |
195 | return (uint32_t)result; |
196 | @@ -121,12 +121,12 @@ uint32_t mp4ff_read_int24(mp4ff_t *f) |
197 | { |
198 | uint32_t result; |
199 | uint32_t a, b, c; |
200 | - int8_t data[4]; |
201 | + uint8_t data[4]; |
202 | |
203 | mp4ff_read_data(f, data, 3); |
204 | - a = (uint8_t)data[0]; |
205 | - b = (uint8_t)data[1]; |
206 | - c = (uint8_t)data[2]; |
207 | + a = data[0]; |
208 | + b = data[1]; |
209 | + c = data[2]; |
210 | |
211 | result = (a<<16) | (b<<8) | c; |
212 | return (uint32_t)result; |
213 | @@ -136,11 +136,11 @@ uint16_t mp4ff_read_int16(mp4ff_t *f) |
214 | { |
215 | uint32_t result; |
216 | uint32_t a, b; |
217 | - int8_t data[2]; |
218 | + uint8_t data[2]; |
219 | |
220 | mp4ff_read_data(f, data, 2); |
221 | - a = (uint8_t)data[0]; |
222 | - b = (uint8_t)data[1]; |
223 | + a = data[0]; |
224 | + b = data[1]; |
225 | |
226 | result = (a<<8) | b; |
227 | return (uint16_t)result; |
228 | @@ -151,7 +151,7 @@ char * mp4ff_read_string(mp4ff_t * f,uin |
229 | char * str = (char*)malloc(length + 1); |
230 | if (str!=0) |
231 | { |
232 | - if ((uint32_t)mp4ff_read_data(f,str,length)!=length) |
233 | + if ((uint32_t)mp4ff_read_data(f,(uint8_t*)str,length)!=length) |
234 | { |
235 | free(str); |
236 | str = 0; |
237 | Index: faad2-2.0/common/mp4v2/mp4meta.cpp |
238 | =================================================================== |
239 | --- faad2-2.0.orig/common/mp4v2/mp4meta.cpp |
240 | +++ faad2-2.0/common/mp4v2/mp4meta.cpp |
241 | @@ -830,7 +830,6 @@ bool MP4File::SetMetadataFreeForm(char * |
242 | MP4BytesProperty *pMetadataProperty = NULL; |
243 | char s[256]; |
244 | int i = 0; |
245 | - bool nameExists = false; |
246 | |
247 | while (1) |
248 | { |
249 | Index: faad2-2.0/common/mp4v2/mp4property.h |
250 | =================================================================== |
251 | --- faad2-2.0.orig/common/mp4v2/mp4property.h |
252 | +++ faad2-2.0/common/mp4v2/mp4property.h |
253 | @@ -21,7 +21,6 @@ |
254 | |
255 | #ifndef __MP4_PROPERTY_INCLUDED__ |
256 | #define __MP4_PROPERTY_INCLUDED__ |
257 | -#define NULL 0 |
258 | |
259 | // forward declarations |
260 | class MP4Atom; |
261 | @@ -44,7 +43,7 @@ enum MP4PropertyType { |
262 | |
263 | class MP4Property { |
264 | public: |
265 | - MP4Property(const char *name = NULL); |
266 | + MP4Property(const char *name = 0); |
267 | |
268 | virtual ~MP4Property() { } |
269 | |
270 | @@ -59,7 +58,7 @@ public: |
271 | return m_name; |
272 | } |
273 | |
274 | - virtual MP4PropertyType GetType() = NULL; |
275 | + virtual MP4PropertyType GetType() = 0; |
276 | |
277 | bool IsReadOnly() { |
278 | return m_readOnly; |
279 | @@ -75,20 +74,20 @@ public: |
280 | m_implicit = value; |
281 | } |
282 | |
283 | - virtual u_int32_t GetCount() = NULL; |
284 | - virtual void SetCount(u_int32_t count) = NULL; |
285 | + virtual u_int32_t GetCount() = 0; |
286 | + virtual void SetCount(u_int32_t count) = 0; |
287 | |
288 | virtual void Generate() { /* default is a no-op */ }; |
289 | |
290 | - virtual void Read(MP4File* pFile, u_int32_t index = 0) = NULL; |
291 | + virtual void Read(MP4File* pFile, u_int32_t index = 0) = 0; |
292 | |
293 | - virtual void Write(MP4File* pFile, u_int32_t index = 0) = NULL; |
294 | + virtual void Write(MP4File* pFile, u_int32_t index = 0) = 0; |
295 | |
296 | virtual void Dump(FILE* pFile, u_int8_t indent, |
297 | - bool dumpImplicits, u_int32_t index = 0) = NULL; |
298 | + bool dumpImplicits, u_int32_t index = 0) = 0; |
299 | |
300 | virtual bool FindProperty(const char* name, |
301 | - MP4Property** ppProperty, u_int32_t* pIndex = NULL); |
302 | + MP4Property** ppProperty, u_int32_t* pIndex = 0); |
303 | |
304 | protected: |
305 | MP4Atom* m_pParentAtom; |
306 | @@ -460,7 +459,7 @@ public: |
307 | bool dumpImplicits, u_int32_t index = 0); |
308 | |
309 | bool FindProperty(const char* name, |
310 | - MP4Property** ppProperty, u_int32_t* pIndex = NULL); |
311 | + MP4Property** ppProperty, u_int32_t* pIndex = 0); |
312 | |
313 | protected: |
314 | virtual void ReadEntry(MP4File* pFile, u_int32_t index); |
315 | @@ -476,7 +475,7 @@ protected: |
316 | |
317 | class MP4DescriptorProperty : public MP4Property { |
318 | public: |
319 | - MP4DescriptorProperty(char* name = NULL, |
320 | + MP4DescriptorProperty(char* name = 0, |
321 | u_int8_t tagsStart = 0, u_int8_t tagsEnd = 0, |
322 | bool mandatory = false, bool onlyOne = false); |
323 | |
324 | @@ -519,7 +518,7 @@ public: |
325 | bool dumpImplicits, u_int32_t index = 0); |
326 | |
327 | bool FindProperty(const char* name, |
328 | - MP4Property** ppProperty, u_int32_t* pIndex = NULL); |
329 | + MP4Property** ppProperty, u_int32_t* pIndex = 0); |
330 | |
331 | protected: |
332 | virtual MP4Descriptor* CreateDescriptor(u_int8_t tag); |
333 | @@ -538,7 +537,7 @@ protected: |
334 | |
335 | class MP4QosQualifierProperty : public MP4DescriptorProperty { |
336 | public: |
337 | - MP4QosQualifierProperty(char* name = NULL, |
338 | + MP4QosQualifierProperty(char* name = 0, |
339 | u_int8_t tagsStart = 0, u_int8_t tagsEnd = 0, |
340 | bool mandatory = false, bool onlyOne = false) : |
341 | MP4DescriptorProperty(name, tagsStart, tagsEnd, mandatory, onlyOne) { } |
342 | Index: faad2-2.0/common/mp4v2/rtphint.h |
343 | =================================================================== |
344 | --- faad2-2.0.orig/common/mp4v2/rtphint.h |
345 | +++ faad2-2.0/common/mp4v2/rtphint.h |
346 | @@ -35,8 +35,8 @@ public: |
347 | return m_pPacket; |
348 | } |
349 | |
350 | - virtual u_int16_t GetDataSize() = NULL; |
351 | - virtual void GetData(u_int8_t* pDest) = NULL; |
352 | + virtual u_int16_t GetDataSize() = 0; |
353 | + virtual void GetData(u_int8_t* pDest) = 0; |
354 | |
355 | MP4Track* FindTrackFromRefIndex(u_int8_t refIndex); |
356 | |
357 | @@ -210,7 +210,7 @@ public: |
358 | |
359 | MP4RtpPacket* GetCurrentPacket() { |
360 | if (m_rtpPackets.Size() == 0) { |
361 | - return NULL; |
362 | + return 0; |
363 | } |
364 | return m_rtpPackets[m_rtpPackets.Size() - 1]; |
365 | } |
366 | @@ -250,10 +250,10 @@ public: |
367 | } |
368 | |
369 | void GetPayload( |
370 | - char** ppPayloadName = NULL, |
371 | - u_int8_t* pPayloadNumber = NULL, |
372 | - u_int16_t* pMaxPayloadSize = NULL, |
373 | - char **ppEncodingParams = NULL); |
374 | + char** ppPayloadName = 0, |
375 | + u_int8_t* pPayloadNumber = 0, |
376 | + u_int16_t* pMaxPayloadSize = 0, |
377 | + char **ppEncodingParams = 0); |
378 | |
379 | void SetPayload( |
380 | const char* payloadName, |
381 | @@ -265,7 +265,7 @@ public: |
382 | |
383 | void ReadHint( |
384 | MP4SampleId hintSampleId, |
385 | - u_int16_t* pNumPackets = NULL); |
386 | + u_int16_t* pNumPackets = 0); |
387 | |
388 | u_int16_t GetHintNumberOfPackets(); |
389 | |
390 | Index: faad2-2.0/frontend/main.c |
391 | =================================================================== |
392 | --- faad2-2.0.orig/frontend/main.c |
393 | +++ faad2-2.0/frontend/main.c |
394 | @@ -36,6 +36,7 @@ |
395 | #include <fcntl.h> |
396 | #include <stdio.h> |
397 | #include <stdlib.h> |
398 | +#include <string.h> |
399 | #include <getopt.h> |
400 | |
401 | #include <faad.h> |
402 | @@ -377,8 +378,8 @@ int decodeAACfile(char *aacfile, char *s |
403 | float *song_length) |
404 | { |
405 | int tagsize; |
406 | - unsigned long samplerate; |
407 | - unsigned char channels; |
408 | + uint32_t samplerate; |
409 | + uint8_t channels; |
410 | void *sample_buffer; |
411 | |
412 | audio_file *aufile; |
413 | @@ -656,7 +657,7 @@ int GetAACTrack(mp4ff_t *infile) |
414 | for (i = 0; i < numTracks; i++) |
415 | { |
416 | unsigned char *buff = NULL; |
417 | - int buff_size = 0; |
418 | + uint32_t buff_size = 0; |
419 | mp4AudioSpecificConfig mp4ASC; |
420 | |
421 | mp4ff_get_decoder_config(infile, i, &buff, &buff_size); |
422 | @@ -687,8 +688,8 @@ int decodeMP4file(char *mp4file, char *s |
423 | int infoOnly, int adts_out, float *song_length) |
424 | { |
425 | int track; |
426 | - unsigned long samplerate; |
427 | - unsigned char channels; |
428 | + uint32_t samplerate; |
429 | + uint8_t channels; |
430 | void *sample_buffer; |
431 | |
432 | mp4ff_t *infile; |
433 | @@ -707,7 +708,7 @@ int decodeMP4file(char *mp4file, char *s |
434 | mp4AudioSpecificConfig mp4ASC; |
435 | |
436 | unsigned char *buffer; |
437 | - int buffer_size; |
438 | + uint32_t buffer_size; |
439 | |
440 | char percents[200]; |
441 | int percent, old_percent = -1; |
442 | Index: faad2-2.0/libfaad/decoder.c |
443 | =================================================================== |
444 | --- faad2-2.0.orig/libfaad/decoder.c |
445 | +++ faad2-2.0/libfaad/decoder.c |
446 | @@ -50,7 +50,7 @@ |
447 | uint16_t dbg_count; |
448 | #endif |
449 | |
450 | -int8_t* FAADAPI faacDecGetErrorMessage(uint8_t errcode) |
451 | +char* FAADAPI faacDecGetErrorMessage(uint8_t errcode) |
452 | { |
453 | if (errcode >= NUM_ERROR_MESSAGES) |
454 | return NULL; |
455 | Index: faad2-2.0/libfaad/decoder.h |
456 | =================================================================== |
457 | --- faad2-2.0.orig/libfaad/decoder.h |
458 | +++ faad2-2.0/libfaad/decoder.h |
459 | @@ -76,7 +76,7 @@ extern "C" { |
460 | #define LFE_CHANNEL (9) |
461 | #define UNKNOWN_CHANNEL (0) |
462 | |
463 | -int8_t* FAADAPI faacDecGetErrorMessage(uint8_t errcode); |
464 | +char* FAADAPI faacDecGetErrorMessage(uint8_t errcode); |
465 | |
466 | uint32_t FAADAPI faacDecGetCapabilities(void); |
467 | |
468 | Index: faad2-2.0/libfaad/error.c |
469 | =================================================================== |
470 | --- faad2-2.0.orig/libfaad/error.c |
471 | +++ faad2-2.0/libfaad/error.c |
472 | @@ -28,7 +28,7 @@ |
473 | #include "common.h" |
474 | #include "error.h" |
475 | |
476 | -int8_t *err_msg[] = { |
477 | +char *err_msg[] = { |
478 | "No error", |
479 | "Gain control not yet implemented", |
480 | "Pulse coding not allowed in short blocks", |
481 | Index: faad2-2.0/libfaad/error.h |
482 | =================================================================== |
483 | --- faad2-2.0.orig/libfaad/error.h |
484 | +++ faad2-2.0/libfaad/error.h |
485 | @@ -33,7 +33,7 @@ extern "C" { |
486 | #endif |
487 | |
488 | #define NUM_ERROR_MESSAGES 26 |
489 | -extern int8_t *err_msg[]; |
490 | +extern char *err_msg[]; |
491 | |
492 | #ifdef __cplusplus |
493 | } |