Commit 8df46a09 authored by Led's avatar Led

0.10.2-rc5

parent 881fc98c
......@@ -19,9 +19,15 @@
/* Define to 1 if `downMatrix' is member of `faacDecConfiguration'. */
#undef HAVE_FAACDECCONFIGURATION_DOWNMATRIX
/* Define to 1 if `samplerate' is member of `faacDecFrameInfo'. */
#undef HAVE_FAACDECFRAMEINFO_SAMPLERATE
/* Define to use FAAD2 for AAC decoding */
#undef HAVE_FAAD
/* Define if FAAD2 uses buflen in function calls */
#undef HAVE_FAAD_BUFLEN_FUNCS
/* Define for FLAC support */
#undef HAVE_FLAC
......@@ -58,6 +64,9 @@
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if the system has the type `mp4AudioSpecificConfig'. */
#undef HAVE_MP4AUDIOSPECIFICCONFIG
/* Define for ogg vorbis support */
#undef HAVE_OGG
......
......@@ -11706,6 +11706,62 @@ fi
if test x$enable_aac = xyes; then
echo "$as_me:$LINENO: checking whether FAAD2_VERSION is declared" >&5
echo $ECHO_N "checking whether FAAD2_VERSION is declared... $ECHO_C" >&6
if test "${ac_cv_have_decl_FAAD2_VERSION+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <faad.h>
int
main ()
{
#ifndef FAAD2_VERSION
char *p = (char *) FAAD2_VERSION;
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_have_decl_FAAD2_VERSION=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_have_decl_FAAD2_VERSION=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_have_decl_FAAD2_VERSION" >&5
echo "${ECHO_T}$ac_cv_have_decl_FAAD2_VERSION" >&6
if test $ac_cv_have_decl_FAAD2_VERSION = yes; then
:
else
enable_aac=no
fi
fi
if test x$enable_aac = xyes; then
echo "$as_me:$LINENO: checking whether faacDecInit2 is declared" >&5
echo $ECHO_N "checking whether faacDecInit2 is declared... $ECHO_C" >&6
if test "${ac_cv_have_decl_faacDecInit2+set}" = set; then
......@@ -11824,6 +11880,177 @@ fi
fi
if test x$enable_aac = xyes; then
echo "$as_me:$LINENO: checking that FAAD2 uses buffer and bufferlen" >&5
echo $ECHO_N "checking that FAAD2 uses buffer and bufferlen... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
#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;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6;
cat >>confdefs.h <<\_ACEOF
#define HAVE_FAAD_BUFLEN_FUNCS 1
_ACEOF
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6;
echo "$as_me:$LINENO: checking that FAAD2 can even be used" >&5
echo $ECHO_N "checking that FAAD2 can even be used... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
#include <faad.h>
int main() {
char buffer;
faacDecHandle decoder;
faacDecFrameInfo frameInfo;
faacDecConfigurationPtr 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);
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);
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6;enable_aac=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
if test x$enable_aac = xyes; then
echo "$as_me:$LINENO: checking for mp4AudioSpecificConfig" >&5
echo $ECHO_N "checking for mp4AudioSpecificConfig... $ECHO_C" >&6
if test "${ac_cv_type_mp4AudioSpecificConfig+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <faad.h>
int
main ()
{
if ((mp4AudioSpecificConfig *) 0)
return 0;
if (sizeof (mp4AudioSpecificConfig))
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_type_mp4AudioSpecificConfig=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_type_mp4AudioSpecificConfig=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_mp4AudioSpecificConfig" >&5
echo "${ECHO_T}$ac_cv_type_mp4AudioSpecificConfig" >&6
if test $ac_cv_type_mp4AudioSpecificConfig = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_MP4AUDIOSPECIFICCONFIG 1
_ACEOF
fi
echo "$as_me:$LINENO: checking for faacDecConfiguration.downMatrix" >&5
echo $ECHO_N "checking for faacDecConfiguration.downMatrix... $ECHO_C" >&6
if test "${ac_cv_member_faacDecConfiguration_downMatrix+set}" = set; then
......@@ -12010,6 +12237,99 @@ _ACEOF
fi
echo "$as_me:$LINENO: checking for faacDecFrameInfo.samplerate" >&5
echo $ECHO_N "checking for faacDecFrameInfo.samplerate... $ECHO_C" >&6
if test "${ac_cv_member_faacDecFrameInfo_samplerate+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <faad.h>
int
main ()
{
static faacDecFrameInfo ac_aggr;
if (ac_aggr.samplerate)
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_member_faacDecFrameInfo_samplerate=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <faad.h>
int
main ()
{
static faacDecFrameInfo ac_aggr;
if (sizeof ac_aggr.samplerate)
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_member_faacDecFrameInfo_samplerate=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_member_faacDecFrameInfo_samplerate=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_member_faacDecFrameInfo_samplerate" >&5
echo "${ECHO_T}$ac_cv_member_faacDecFrameInfo_samplerate" >&6
if test $ac_cv_member_faacDecFrameInfo_samplerate = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_FAACDECFRAMEINFO_SAMPLERATE 1
_ACEOF
fi
cat >>confdefs.h <<\_ACEOF
......
......@@ -278,13 +278,77 @@ if test x$enable_aac = xyes; then
CPPFLAGS=$CFLAGS
AC_CHECK_HEADER(faad.h,,enable_aac=no)
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>])
fi
if test x$enable_aac = xyes; then
AC_CHECK_LIB(faad,faacDecInit2,[MPD_LIBS="$MPD_LIBS $FAAD_LIBS";MPD_CFLAGS="$MPD_CFLAGS $FAAD_CFLAGS";MP4FF_SUBDIR="mp4ff";MP4FF_LIB="mp4ff/libmp4ff.la"],enable_aac=no)
fi
if test x$enable_aac = xyes; then
AC_CHECK_MEMBERS([faacDecConfiguration.downMatrix,faacDecConfiguration.dontUpSampleImplicitSBR],,,[#include <faad.h>])
AC_MSG_CHECKING(that FAAD2 uses buffer and bufferlen)
AC_COMPILE_IFELSE([
#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([
#include <faad.h>
int main() {
char buffer;
faacDecHandle decoder;
faacDecFrameInfo frameInfo;
faacDecConfigurationPtr 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);
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);
return 0;
}
],AC_MSG_RESULT(yes),[AC_MSG_RESULT(no);enable_aac=no])
])
fi
if test x$enable_aac = xyes; then
AC_CHECK_TYPES(mp4AudioSpecificConfig,,,[#include <faad.h>])
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])
......
......@@ -210,6 +210,7 @@ float getAacFloatTotalTime(char * file) {
unsigned long sampleRate;
unsigned char channels;
FILE * fp = fopen(file,"r");
size_t bread;
if(fp==NULL) return -1;
......@@ -223,12 +224,13 @@ float getAacFloatTotalTime(char * file) {
faacDecSetConfiguration(decoder,config);
fillAacBuffer(&b);
if(faacDecInit(decoder,b.buffer,b.bytesIntoBuffer,
&sampleRate,&channels) >= 0 &&
sampleRate > 0 && channels > 0)
{
length = 0;
}
#ifdef HAVE_FAAD_BUFLEN_FUNCS
bread = faacDecInit(decoder,b.buffer,b.bytesIntoBuffer,
&sampleRate,&channels);
#else
bread = faacDecInit(decoder,b.buffer,&sampleRate,&channels);
#endif
if(bread >= 0 && sampleRate > 0 && channels > 0) length = 0;
faacDecClose(decoder);
}
......@@ -291,9 +293,14 @@ int aac_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) {
faacDecSetConfiguration(decoder,config);
fillAacBuffer(&b);
if((bread = faacDecInit(decoder,b.buffer,b.bytesIntoBuffer,
&sampleRate,&channels)) < 0)
{
#ifdef HAVE_FAAD_BUFLEN_FUNCS
bread = faacDecInit(decoder,b.buffer,b.bytesIntoBuffer,
&sampleRate,&channels);
#else
bread = faacDecInit(decoder,b.buffer,&sampleRate,&channels);
#endif
if(bread < 0) {
ERROR("Error not a AAC stream.\n");
faacDecClose(decoder);
fclose(b.infile);
......@@ -317,8 +324,12 @@ int aac_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) {
break;
}
#ifdef HAVE_FAAD_BUFLEN_FUNCS
sampleBuffer = faacDecDecode(decoder,&frameInfo,b.buffer,
b.bytesIntoBuffer);
#else
sampleBuffer = faacDecDecode(decoder,&frameInfo,b.buffer);
#endif
if(frameInfo.error > 0) {
ERROR("error decoding AAC file: %s\n",dc->file);
......@@ -328,9 +339,13 @@ int aac_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) {
break;
}
#ifdef HAVE_FAACDECFRAMEINFO_SAMPLERATE
sampleRate = frameInfo.samplerate;
#endif
if(dc->start) {
af->channels = frameInfo.channels;
af->sampleRate = frameInfo.samplerate;
af->sampleRate = sampleRate;
dc->state = DECODE_STATE_DECODE;
dc->start = 0;
}
......@@ -341,10 +356,10 @@ int aac_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) {
if(sampleCount>0) {
bitRate = frameInfo.bytesconsumed*8.0*
frameInfo.channels*frameInfo.samplerate/
frameInfo.channels*sampleRate/
frameInfo.samples/1024+0.5;
time+= (float)(frameInfo.samples)/frameInfo.channels/
frameInfo.samplerate;
sampleRate;
}
sampleBufferLen = sampleCount*2;
......
......@@ -44,12 +44,24 @@ int mp4_getAACTrack(mp4ff_t *infile) {
for (i = 0; i < numTracks; i++) {
unsigned char *buff = NULL;
int buff_size = 0;
#ifdef HAVE_MP4AUDIOSPECIFICCONFIG
mp4AudioSpecificConfig mp4ASC;
#else
unsigned long dummy1_32;
unsigned char dummy2_8, dummy3_8, dummy4_8, dummy5_8, dummy6_8,
dummy7_8, dummy8_8;
#endif
mp4ff_get_decoder_config(infile, i, &buff, &buff_size);
if (buff) {
#ifdef HAVE_MP4AUDIOSPECIFICCONFIG
rc = AudioSpecificConfig(buff, buff_size, &mp4ASC);
#else
rc = AudioSpecificConfig(buff, &dummy1_32, &dummy2_8,
&dummy3_8, &dummy4_8, &dummy5_8,
&dummy6_8, &dummy7_8, &dummy8_8);
#endif
free(buff);
if (rc < 0) continue;
return i;
......@@ -220,8 +232,12 @@ int mp4_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) {
continue;
}
#ifdef HAVE_FAAD_BUFLEN_FUNCS
sampleBuffer = faacDecDecode(decoder,&frameInfo,mp4Buffer,
mp4BufferSize);
#else
sampleBuffer = faacDecDecode(decoder,&frameInfo,mp4Buffer);
#endif
if(mp4Buffer) free(mp4Buffer);
if(frameInfo.error > 0) {
......@@ -234,9 +250,11 @@ int mp4_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) {
if(dc->start) {
channels = frameInfo.channels;
#ifdef HAVE_FAACDECFRAMEINFO_SAMPLERATE
scale = frameInfo.samplerate;
#endif
af->sampleRate = scale;
af->channels = frameInfo.channels;
af->sampleRate = frameInfo.samplerate;
dc->state = DECODE_STATE_DECODE;
dc->start = 0;
}
......
......@@ -15,9 +15,16 @@ typedef unsigned __int64 uint64_t;
#else
#include <stdint.h>
#include "../../config.h"
#ifdef HAVE_STDINT_H
#include <stdint.h>
#else
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#endif
#endif
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment