summaryrefslogtreecommitdiff
path: root/faad2/faad2-2.0-gcc4.patch
blob: 8e4c9a0bc187ee1802501b927ed99d907b192cb5 (plain)
    1 # Looks a lot like Gentoo's 021_all_gcc4.patch, imho --Sten
    2 diff -ru faad2.orig/common/mp4ff/mp4atom.c faad2/common/mp4ff/mp4atom.c
    3 --- faad2.orig/common/mp4ff/mp4atom.c	2004-01-11 16:52:18.000000000 +0100
    4 +++ faad2/common/mp4ff/mp4atom.c	2006-03-05 11:48:17.000000000 +0100
    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 @@
   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 diff -ru faad2.orig/common/mp4ff/mp4ff.h faad2/common/mp4ff/mp4ff.h
   36 --- faad2.orig/common/mp4ff/mp4ff.h	2004-01-11 16:52:18.000000000 +0100
   37 +++ faad2/common/mp4ff/mp4ff.h	2006-03-05 11:48:17.000000000 +0100
   38 @@ -125,4 +125,4 @@
   39  }
   40  #endif /* __cplusplus */
   41  
   42 -#endif
   43 \ No newline at end of file
   44 +#endif
   45 diff -ru faad2.orig/common/mp4ff/mp4ff_int_types.h faad2/common/mp4ff/mp4ff_int_types.h
   46 --- faad2.orig/common/mp4ff/mp4ff_int_types.h	2003-12-13 23:26:56.000000000 +0100
   47 +++ faad2/common/mp4ff/mp4ff_int_types.h	2006-03-05 11:48:18.000000000 +0100
   48 @@ -20,4 +20,4 @@
   49  #endif
   50  
   51  
   52 -#endif
   53 \ No newline at end of file
   54 +#endif
   55 diff -ru faad2.orig/common/mp4ff/mp4ffint.h faad2/common/mp4ff/mp4ffint.h
   56 --- faad2.orig/common/mp4ff/mp4ffint.h	2004-01-14 21:50:22.000000000 +0100
   57 +++ faad2/common/mp4ff/mp4ffint.h	2006-03-05 11:48:18.000000000 +0100
   58 @@ -226,8 +226,8 @@
   59  
   60  
   61  /* mp4util.c */
   62 -int32_t mp4ff_read_data(mp4ff_t *f, int8_t *data, uint32_t size);
   63 -int32_t mp4ff_write_data(mp4ff_t *f, int8_t *data, uint32_t size);
   64 +int32_t mp4ff_read_data(mp4ff_t *f, uint8_t *data, uint32_t size);
   65 +int32_t mp4ff_write_data(mp4ff_t *f, uint8_t *data, uint32_t size);
   66  uint64_t mp4ff_read_int64(mp4ff_t *f);
   67  uint32_t mp4ff_read_int32(mp4ff_t *f);
   68  uint32_t mp4ff_read_int24(mp4ff_t *f);
   69 @@ -241,7 +241,7 @@
   70  char * mp4ff_read_string(mp4ff_t * f,uint32_t length);
   71  
   72  /* mp4atom.c */
   73 -static int32_t mp4ff_atom_get_size(const int8_t *data);
   74 +static int32_t mp4ff_atom_get_size(const uint8_t *data);
   75  static int32_t mp4ff_atom_compare(const int8_t a1, const int8_t b1, const int8_t c1, const int8_t d1,
   76                                    const int8_t a2, const int8_t b2, const int8_t c2, const int8_t d2);
   77  static uint8_t mp4ff_atom_name_to_type(const int8_t a, const int8_t b, const int8_t c, const int8_t d);
   78 @@ -301,7 +301,6 @@
   79  mp4ff_t *mp4ff_open_edit(mp4ff_callback_t *f);
   80  #endif
   81  void mp4ff_close(mp4ff_t *ff);
   82 -void mp4ff_track_add(mp4ff_t *f);
   83  int32_t parse_sub_atoms(mp4ff_t *f, const uint64_t total_size);
   84  int32_t parse_atoms(mp4ff_t *f);
   85  
   86 @@ -326,4 +325,4 @@
   87  }
   88  #endif /* __cplusplus */
   89  
   90 -#endif
   91 \ No newline at end of file
   92 +#endif
   93 diff -ru faad2.orig/common/mp4ff/mp4meta.c faad2/common/mp4ff/mp4meta.c
   94 --- faad2.orig/common/mp4ff/mp4meta.c	2004-01-11 16:52:18.000000000 +0100
   95 +++ faad2/common/mp4ff/mp4meta.c	2006-03-05 11:48:18.000000000 +0100
   96 @@ -411,4 +411,4 @@
   97      return mp4ff_meta_find_by_name(f, "cover", value);
   98  }
   99  
  100 -#endif
  101 \ No newline at end of file
  102 +#endif
  103 diff -ru faad2.orig/common/mp4ff/mp4tagupdate.c faad2/common/mp4ff/mp4tagupdate.c
  104 --- faad2.orig/common/mp4ff/mp4tagupdate.c	2004-01-06 12:59:47.000000000 +0100
  105 +++ faad2/common/mp4ff/mp4tagupdate.c	2006-03-05 11:48:18.000000000 +0100
  106 @@ -143,7 +143,7 @@
  107  	bufptr = membuffer_get_ptr(buf);
  108  	if (bufptr==0) return 0;
  109  	
  110 -	if ((unsigned)mp4ff_read_data(src,(char*)bufptr + oldsize,bytes)!=bytes)
  111 +	if ((unsigned)mp4ff_read_data(src,(uint8_t*)bufptr + oldsize,bytes)!=bytes)
  112  	{
  113  		membuffer_set_error(buf);
  114  		return 0;
  115 @@ -398,7 +398,7 @@
  116  	uint64_t atom_offset = base;
  117  	for(;;)
  118  	{
  119 -		char atom_name[4];
  120 +		uint8_t atom_name[4];
  121  		uint32_t atom_size;
  122  
  123  		mp4ff_set_position(f,atom_offset);
  124 @@ -618,7 +618,7 @@
  125      /* copy moov atom to end of the file */
  126      if (ff->last_atom != ATOM_MOOV)
  127      {
  128 -        char *free_data = "free";
  129 +        uint8_t *free_data = (uint8_t*)"free";
  130  
  131          /* rename old moov to free */
  132          mp4ff_set_position(ff, ff->moov_offset + 4);
  133 @@ -626,14 +626,14 @@
  134  	
  135          mp4ff_set_position(ff, ff->file_size);
  136  		mp4ff_write_int32(ff,new_moov_size + 8);
  137 -		mp4ff_write_data(ff,"moov",4);
  138 +		mp4ff_write_data(ff,(uint8_t*)"moov",4);
  139  		mp4ff_write_data(ff, new_moov_data, new_moov_size);
  140      }
  141  	else
  142  	{
  143          mp4ff_set_position(ff, ff->moov_offset);
  144  		mp4ff_write_int32(ff,new_moov_size + 8);
  145 -		mp4ff_write_data(ff,"moov",4);
  146 +		mp4ff_write_data(ff,(uint8_t*)"moov",4);
  147  		mp4ff_write_data(ff, new_moov_data, new_moov_size);
  148  	}
  149  
  150 diff -ru faad2.orig/common/mp4ff/mp4util.c faad2/common/mp4ff/mp4util.c
  151 --- faad2.orig/common/mp4ff/mp4util.c	2004-01-11 16:52:19.000000000 +0100
  152 +++ faad2/common/mp4ff/mp4util.c	2006-03-05 11:48:18.000000000 +0100
  153 @@ -28,7 +28,7 @@
  154  #include "mp4ffint.h"
  155  #include <stdlib.h>
  156  
  157 -int32_t mp4ff_read_data(mp4ff_t *f, int8_t *data, uint32_t size)
  158 +int32_t mp4ff_read_data(mp4ff_t *f, uint8_t *data, uint32_t size)
  159  {
  160      int32_t result = 1;
  161  
  162 @@ -44,7 +44,7 @@
  163  	return f->stream->truncate(f->stream->user_data);
  164  }
  165  
  166 -int32_t mp4ff_write_data(mp4ff_t *f, int8_t *data, uint32_t size)
  167 +int32_t mp4ff_write_data(mp4ff_t *f, uint8_t *data, uint32_t size)
  168  {
  169      int32_t result = 1;
  170  
  171 @@ -105,13 +105,13 @@
  172  {
  173      uint32_t result;
  174      uint32_t a, b, c, d;
  175 -    int8_t data[4];
  176 +    uint8_t data[4];
  177      
  178      mp4ff_read_data(f, data, 4);
  179 -    a = (uint8_t)data[0];
  180 -    b = (uint8_t)data[1];
  181 -    c = (uint8_t)data[2];
  182 -    d = (uint8_t)data[3];
  183 +    a = data[0];
  184 +    b = data[1];
  185 +    c = data[2];
  186 +    d = data[3];
  187  
  188      result = (a<<24) | (b<<16) | (c<<8) | d;
  189      return (uint32_t)result;
  190 @@ -121,12 +121,12 @@
  191  {
  192      uint32_t result;
  193      uint32_t a, b, c;
  194 -    int8_t data[4];
  195 +    uint8_t data[4];
  196      
  197      mp4ff_read_data(f, data, 3);
  198 -    a = (uint8_t)data[0];
  199 -    b = (uint8_t)data[1];
  200 -    c = (uint8_t)data[2];
  201 +    a = data[0];
  202 +    b = data[1];
  203 +    c = data[2];
  204  
  205      result = (a<<16) | (b<<8) | c;
  206      return (uint32_t)result;
  207 @@ -136,11 +136,11 @@
  208  {
  209      uint32_t result;
  210      uint32_t a, b;
  211 -    int8_t data[2];
  212 +    uint8_t data[2];
  213      
  214      mp4ff_read_data(f, data, 2);
  215 -    a = (uint8_t)data[0];
  216 -    b = (uint8_t)data[1];
  217 +    a = data[0];
  218 +    b = data[1];
  219  
  220      result = (a<<8) | b;
  221      return (uint16_t)result;
  222 @@ -151,7 +151,7 @@
  223  	char * str = (char*)malloc(length + 1);
  224  	if (str!=0)
  225  	{
  226 -		if ((uint32_t)mp4ff_read_data(f,str,length)!=length)
  227 +		if ((uint32_t)mp4ff_read_data(f,(uint8_t*)str,length)!=length)
  228  		{
  229  			free(str);
  230  			str = 0;
  231 diff -ru faad2.orig/common/mp4v2/mp4meta.cpp faad2/common/mp4v2/mp4meta.cpp
  232 --- faad2.orig/common/mp4v2/mp4meta.cpp	2003-08-03 14:17:20.000000000 +0200
  233 +++ faad2/common/mp4v2/mp4meta.cpp	2006-03-05 11:48:18.000000000 +0100
  234 @@ -830,7 +830,6 @@
  235      MP4BytesProperty *pMetadataProperty = NULL;
  236      char s[256];
  237      int i = 0;
  238 -    bool nameExists = false;
  239  
  240      while (1)
  241      {
  242 diff -ru faad2.orig/common/mp4v2/rtphint.h faad2/common/mp4v2/rtphint.h
  243 --- faad2.orig/common/mp4v2/rtphint.h	2003-06-29 23:41:00.000000000 +0200
  244 +++ faad2/common/mp4v2/rtphint.h	2006-03-05 11:48:18.000000000 +0100
  245 @@ -35,8 +35,8 @@
  246  		return m_pPacket;
  247  	}
  248  
  249 -	virtual u_int16_t GetDataSize() = NULL;
  250 -	virtual void GetData(u_int8_t* pDest) = NULL;
  251 +	virtual u_int16_t GetDataSize() = 0;
  252 +	virtual void GetData(u_int8_t* pDest) = 0;
  253  
  254  	MP4Track* FindTrackFromRefIndex(u_int8_t refIndex);
  255  
  256 @@ -210,7 +210,7 @@
  257  
  258  	MP4RtpPacket* GetCurrentPacket() {
  259  		if (m_rtpPackets.Size() == 0) {
  260 -			return NULL;
  261 +			return 0;
  262  		}
  263  		return m_rtpPackets[m_rtpPackets.Size() - 1];
  264  	}
  265 @@ -250,10 +250,10 @@
  266  	}
  267  
  268  	void GetPayload(
  269 -		char** ppPayloadName = NULL,
  270 -		u_int8_t* pPayloadNumber = NULL,
  271 -		u_int16_t* pMaxPayloadSize = NULL,
  272 -		char **ppEncodingParams = NULL);
  273 +		char** ppPayloadName = 0,
  274 +		u_int8_t* pPayloadNumber = 0,
  275 +		u_int16_t* pMaxPayloadSize = 0,
  276 +		char **ppEncodingParams = 0);
  277  
  278  	void SetPayload(
  279  		const char* payloadName,
  280 @@ -265,7 +265,7 @@
  281  
  282  	void ReadHint(
  283  		MP4SampleId hintSampleId,
  284 -		u_int16_t* pNumPackets = NULL);
  285 +		u_int16_t* pNumPackets = 0);
  286  
  287  	u_int16_t GetHintNumberOfPackets();
  288  
  289 diff -ru faad2.orig/frontend/main.c faad2/frontend/main.c
  290 --- faad2.orig/frontend/main.c	2004-01-06 12:59:47.000000000 +0100
  291 +++ faad2/frontend/main.c	2006-03-05 11:48:18.000000000 +0100
  292 @@ -36,6 +36,7 @@
  293  #include <fcntl.h>
  294  #include <stdio.h>
  295  #include <stdlib.h>
  296 +#include <string.h>
  297  #include <getopt.h>
  298  
  299  #include <faad.h>
  300 @@ -377,8 +378,8 @@
  301                    float *song_length)
  302  {
  303      int tagsize;
  304 -    unsigned long samplerate;
  305 -    unsigned char channels;
  306 +    uint32_t samplerate;
  307 +    uint8_t channels;
  308      void *sample_buffer;
  309  
  310      audio_file *aufile;
  311 @@ -656,7 +657,7 @@
  312      for (i = 0; i < numTracks; i++)
  313      {
  314          unsigned char *buff = NULL;
  315 -        int buff_size = 0;
  316 +        uint32_t buff_size = 0;
  317          mp4AudioSpecificConfig mp4ASC;
  318  
  319          mp4ff_get_decoder_config(infile, i, &buff, &buff_size);
  320 @@ -687,8 +688,8 @@
  321                    int infoOnly, int adts_out, float *song_length)
  322  {
  323      int track;
  324 -    unsigned long samplerate;
  325 -    unsigned char channels;
  326 +    uint32_t samplerate;
  327 +    uint8_t channels;
  328      void *sample_buffer;
  329  
  330      mp4ff_t *infile;
  331 @@ -707,7 +708,7 @@
  332      mp4AudioSpecificConfig mp4ASC;
  333  
  334      unsigned char *buffer;
  335 -    int buffer_size;
  336 +    uint32_t buffer_size;
  337  
  338      char percents[200];
  339      int percent, old_percent = -1;
  340 diff -ru faad2.orig/libfaad/decoder.c faad2/libfaad/decoder.c
  341 --- faad2.orig/libfaad/decoder.c	2004-02-04 21:07:24.000000000 +0100
  342 +++ faad2/libfaad/decoder.c	2006-03-05 11:48:18.000000000 +0100
  343 @@ -50,7 +50,7 @@
  344  uint16_t dbg_count;
  345  #endif
  346  
  347 -int8_t* FAADAPI faacDecGetErrorMessage(uint8_t errcode)
  348 +char* FAADAPI faacDecGetErrorMessage(uint8_t errcode)
  349  {
  350      if (errcode >= NUM_ERROR_MESSAGES)
  351          return NULL;
  352 diff -ru faad2.orig/libfaad/decoder.h faad2/libfaad/decoder.h
  353 --- faad2.orig/libfaad/decoder.h	2004-01-05 15:05:11.000000000 +0100
  354 +++ faad2/libfaad/decoder.h	2006-03-05 11:48:18.000000000 +0100
  355 @@ -76,7 +76,7 @@
  356  #define LFE_CHANNEL          (9)
  357  #define UNKNOWN_CHANNEL      (0)
  358  
  359 -int8_t* FAADAPI faacDecGetErrorMessage(uint8_t errcode);
  360 +char* FAADAPI faacDecGetErrorMessage(uint8_t errcode);
  361  
  362  uint32_t FAADAPI faacDecGetCapabilities(void);
  363  
  364 diff -ru faad2.orig/libfaad/error.c faad2/libfaad/error.c
  365 --- faad2.orig/libfaad/error.c	2004-01-28 20:17:25.000000000 +0100
  366 +++ faad2/libfaad/error.c	2006-03-05 11:48:18.000000000 +0100
  367 @@ -28,7 +28,7 @@
  368  #include "common.h"
  369  #include "error.h"
  370  
  371 -int8_t *err_msg[] = {
  372 +char *err_msg[] = {
  373      "No error",
  374      "Gain control not yet implemented",
  375      "Pulse coding not allowed in short blocks",
  376 diff -ru faad2.orig/libfaad/error.h faad2/libfaad/error.h
  377 --- faad2.orig/libfaad/error.h	2004-01-28 20:17:25.000000000 +0100
  378 +++ faad2/libfaad/error.h	2006-03-05 11:48:18.000000000 +0100
  379 @@ -33,7 +33,7 @@
  380  #endif
  381  
  382  #define NUM_ERROR_MESSAGES 26
  383 -extern int8_t *err_msg[];
  384 +extern char *err_msg[];
  385  
  386  #ifdef __cplusplus
  387  }

Generated by cgit