aboutsummaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-29 16:17:15 +0100
committerMax Kellermann <max@duempel.org>2013-01-29 16:17:15 +0100
commit3dd8beb3809d9c61d21e12e7422cca3cbb2afc59 (patch)
treec226da9d95a0f9f4ecfed0dc5d0aca9354dea35e /m4
parentae77406b8ebfa3462f776f2d0b9bf4ee0ca36d8d (diff)
downloadmpd-3dd8beb3809d9c61d21e12e7422cca3cbb2afc59.tar.gz
mpd-3dd8beb3809d9c61d21e12e7422cca3cbb2afc59.tar.xz
mpd-3dd8beb3809d9c61d21e12e7422cca3cbb2afc59.zip
decoder/faad: use the newer NeAAC* API
Drop support for the old faacDec* API.
Diffstat (limited to 'm4')
-rw-r--r--m4/faad.m465
1 files changed, 12 insertions, 53 deletions
diff --git a/m4/faad.m4 b/m4/faad.m4
index cda4298e3..5ca520e79 100644
--- a/m4/faad.m4
+++ b/m4/faad.m4
@@ -23,77 +23,36 @@ if test x$enable_aac = xyes; then
AC_CHECK_DECL(FAAD2_VERSION,,enable_aac=no,[#include <faad.h>])
fi
if test x$enable_aac = xyes; then
- AC_CHECK_DECL(faacDecInit2,,enable_aac=no,[#include <faad.h>])
+ AC_CHECK_LIB(faad,NeAACDecInit2,,enable_aac=no)
fi
if test x$enable_aac = xyes; then
- AC_CHECK_LIB(faad,faacDecInit2,,enable_aac=no)
- if test x$enable_aac = xno; then
- enable_aac=yes
- AC_CHECK_LIB(faad,NeAACDecInit2,,enable_aac=no)
- fi
- fi
- if test x$enable_aac = xyes; then
- AC_MSG_CHECKING(that FAAD2 uses buffer and bufferlen)
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([
-#include <faad.h>
-
-int main() {
- char buffer;
- long bufferlen = 0;
- faacDecHandle decoder;
- faacDecFrameInfo frameInfo;
- faacDecConfigurationPtr config;
- unsigned char channels;
- long sampleRate;
- mp4AudioSpecificConfig mp4ASC;
-
- decoder = faacDecOpen();
- config = faacDecGetCurrentConfiguration(decoder);
- config->outputFormat = FAAD_FMT_16BIT;
- faacDecSetConfiguration(decoder,config);
- AudioSpecificConfig(&buffer, bufferlen, &mp4ASC);
- faacDecInit(decoder,&buffer,bufferlen,&sampleRate,&channels);
- faacDecInit2(decoder,&buffer,bufferlen,&sampleRate,&channels);
- faacDecDecode(decoder,&frameInfo,&buffer,bufferlen);
-
- return 0;
-}
-])],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_FAAD_BUFLEN_FUNCS,1,[Define if FAAD2 uses buflen in function calls])],[AC_MSG_RESULT(no);
AC_MSG_CHECKING(that FAAD2 can even be used)
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#include <faad.h>
int main() {
char buffer;
- faacDecHandle decoder;
- faacDecFrameInfo frameInfo;
- faacDecConfigurationPtr config;
+ NeAACDecHandle decoder;
+ NeAACDecFrameInfo frameInfo;
+ NeAACDecConfigurationPtr config;
unsigned char channels;
long sampleRate;
long bufferlen = 0;
- unsigned long dummy1_32;
- unsigned char dummy2_8, dummy3_8, dummy4_8, dummy5_8, dummy6_8,
- dummy7_8, dummy8_8;
- decoder = faacDecOpen();
- config = faacDecGetCurrentConfiguration(decoder);
+ decoder = NeAACDecOpen();
+ config = NeAACDecGetCurrentConfiguration(decoder);
config->outputFormat = FAAD_FMT_16BIT;
- faacDecSetConfiguration(decoder,config);
- AudioSpecificConfig(&buffer,&dummy1_32,&dummy2_8,
- &dummy3_8,&dummy4_8,&dummy5_8,
- &dummy6_8,&dummy7_8,&dummy8_8);
- faacDecInit(decoder,&buffer,&sampleRate,&channels);
- faacDecInit2(decoder,&buffer,bufferlen,&sampleRate,&channels);
- faacDecDecode(decoder,&frameInfo,&buffer);
- faacDecClose(decoder);
+ NeAACDecSetConfiguration(decoder,config);
+ NeAACDecInit(decoder,&buffer,bufferlen,&sampleRate,&channels);
+ NeAACDecInit2(decoder,&buffer,bufferlen,&sampleRate,&channels);
+ NeAACDecDecode(decoder,&frameInfo,&buffer,bufferlen);
+ NeAACDecClose(decoder);
return 0;
}
])],AC_MSG_RESULT(yes),[AC_MSG_RESULT(no);enable_aac=no])
- ])
fi
if test x$enable_aac = xyes; then
- AC_CHECK_MEMBERS([faacDecConfiguration.downMatrix,faacDecConfiguration.dontUpSampleImplicitSBR,faacDecFrameInfo.samplerate],,,[#include <faad.h>])
AC_DEFINE(HAVE_FAAD,1,[Define to use FAAD2 for AAC decoding])
else
AC_MSG_WARN([faad2 lib needed for MP4/AAC support -- disabling MP4/AAC support])
@@ -121,7 +80,7 @@ int main() {
unsigned char channels;
uint32_t sample_rate;
- faacDecInit2(NULL, NULL, 0, &sample_rate, &channels);
+ NeAACDecInit2(NULL, NULL, 0, &sample_rate, &channels);
return 0;
}
])],