Page 1 of 1

audiotoolboxdec.c fails to compile on OS X 10.5

PostPosted: Wed Aug 31, 2016 2:46 am
by David Hillman
Does anyone happen to know how to get audiotoolboxdec.c to compile on OS X 10.5.8 with gcc (4.0.1)? Or if there's an older release that I can download which will build on this OS? Or another option?

I just downloaded ffmpeg 3.1.3 today, and attempted to compile it. All went well until it reached...

Code: Select all
...snipped for brevity...
CC   libavcodec/assenc.o
CC   libavcodec/asv.o
CC   libavcodec/asvdec.o
CC   libavcodec/asvenc.o
CC   libavcodec/atrac.o
CC   libavcodec/atrac1.o
CC   libavcodec/atrac3.o
CC   libavcodec/atrac3plus.o
CC   libavcodec/atrac3plusdec.o
CC   libavcodec/atrac3plusdsp.o
CC   libavcodec/audio_frame_queue.o
CC   libavcodec/audioconvert.o
CC   libavcodec/audiodsp.o
CC   libavcodec/audiotoolboxdec.o
libavcodec/audiotoolboxdec.c: In function ‘ffat_get_format_id’:
libavcodec/audiotoolboxdec.c:73: error: ‘kAudioFormatMicrosoftGSM’ undeclared (first use in this function)
libavcodec/audiotoolboxdec.c:73: error: (Each undeclared identifier is reported only once
libavcodec/audiotoolboxdec.c:73: error: for each function it appears in.)
libavcodec/audiotoolboxdec.c:75: error: ‘kAudioFormatiLBC’ undeclared (first use in this function)
libavcodec/audiotoolboxdec.c: In function ‘ffat_create_decoder’:
libavcodec/audiotoolboxdec.c:345: warning: passing argument 3 of ‘ff_mpa_decode_header’ from incompatible pointer type
libavcodec/audiotoolboxdec.c: In function ‘ffat_decode’:
libavcodec/audiotoolboxdec.c:550: warning: passing argument 4 of ‘AudioConverterFillComplexBuffer’ from incompatible pointer type
libavcodec/audiotoolboxdec.c:561: warning: format ‘%i’ expects type ‘int’, but argument 4 has type ‘OSStatus’
make: *** [libavcodec/audiotoolboxdec.o] Error 1


I searched for 'audiotoolboxdec' here, but came up empty. Please advise, thanks.

PS The 'Upload attachment' feature here is broken. Regardless of the filename, it says "extension not allowed", even if you don't use an extension at all.

Re: audiotoolboxdec.c fails to compile on OS X 10.5

PostPosted: Thu Feb 16, 2017 9:19 am
by frosen
Hello David,

Create a new file libavcodec/osxcompat.h with the following contents:

Code: Select all
#ifndef kAudioFormatMicrosoftGSM
#define kAudioFormatMicrosoftGSM 0x6D730031
#endif

#ifndef kAudioFormatiLBC
#define kAudioFormatiLBC 'ilbc'
#endif

#ifndef kAudioFormatMPEG4AAC_ELD
#define kAudioFormatMPEG4AAC_ELD 'aace'
#endif



Then, at the beginning of the two files
libavcodec/audiotoolboxdec.c and
libavcodec/audiotoolboxenc.c

include this file using

Code: Select all
#include "osxcompat.h"