Skip to content

Commit

Permalink
Merge pull request #196 from rafael2k/fdk-aac
Browse files Browse the repository at this point in the history
Use FDK-AAC support instead of libaacplus for MPEG-4 AAC support
  • Loading branch information
rafael2k authored Jun 24, 2024
2 parents 0f255b6 + fa7a02d commit a0be42f
Show file tree
Hide file tree
Showing 6 changed files with 214 additions and 71 deletions.
22 changes: 11 additions & 11 deletions darkice/trunk/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,15 @@ fi
dnl-----------------------------------------------------------------------------
dnl link the aacplus library if requested
dnl-----------------------------------------------------------------------------
AC_ARG_WITH(aacplus,
AS_HELP_STRING([--with-aacplus], [use aacplus for encoding AAC HEv2 streams @<:@check@:>@]),
[], with_aacplus=check)
AS_CASE([$with_aacplus],
check, [PKG_CHECK_MODULES(AACPLUS, aacplus, [], true)],
yes, [PKG_CHECK_MODULES(AACPLUS, aacplus)],
AC_MSG_RESULT([building without aacplus]))
AS_IF(test -n "$AACPLUS_LIBS",
AC_DEFINE(HAVE_AACPLUS_LIB, 1, [build with aacplus library]))
AC_ARG_WITH(fdkaac,
AS_HELP_STRING([--with-fdkaac], [use fdk-aac for encoding AAC HEv2 streams @<:@check@:>@]),
[], with_fdkaac=check)
AS_CASE([$with_fdkaac],
check, [PKG_CHECK_MODULES(FDKAAC, fdk-aac, [], true)],
yes, [PKG_CHECK_MODULES(FDKAAC, fdk-aac)],
AC_MSG_RESULT([building without fdk-aac]))
AS_IF(test -n "$FDKAAC_LIBS",
AC_DEFINE(HAVE_FDKAAC_LIB, 1, [build with fdk-aac library]))

dnl-----------------------------------------------------------------------------
dnl link the twolame library if requested
Expand All @@ -187,9 +187,9 @@ if test -z "x${LAME_LIBS}" \
-a -z "${OPUS_LIBS}" \
-a -z "${FLAC_LIBS}" \
-a -z "${FAAC_LIBS}" \
-a -z "${AACPLUS_LIBS}" \
-a -z "${FDKAAC_LIBS}" \
-a -z "${TWOLAME_LIBS}" ; then
AC_MSG_ERROR([neither lame, Ogg Vorbis, opus, FLAC, faac, aac+ nor twolame configured])
AC_MSG_ERROR([neither lame, Ogg Vorbis, opus, FLAC, faac, fdk-aac nor twolame configured])
fi


Expand Down
10 changes: 5 additions & 5 deletions darkice/trunk/src/DarkIce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
#include "FaacEncoder.h"
#endif

#ifdef HAVE_AACPLUS_LIB
#ifdef HAVE_FDKAAC_LIB
#include "aacPlusEncoder.h"
#endif

Expand Down Expand Up @@ -741,7 +741,7 @@ DarkIce :: configIceCast2 ( const Config & config,
break;

case IceCast2::aacp:
#ifndef HAVE_AACPLUS_LIB
#ifndef HAVE_FDKAAC_LIB
throw Exception( __FILE__, __LINE__,
"DarkIce not compiled with AAC+ support, "
"thus can't aacp stream: ",
Expand All @@ -756,7 +756,7 @@ DarkIce :: configIceCast2 ( const Config & config,
sampleRate,
channel );

#endif // HAVE_AACPLUS_LIB
#endif // HAVE_FDKAAC_LIB
break;

default:
Expand Down Expand Up @@ -1178,7 +1178,7 @@ DarkIce :: configFileCast ( const Config & config )
dsp->getChannel());
#endif // HAVE_FAAC_LIB
} else if ( Util::strEq( format, "aacp") ) {
#ifndef HAVE_AACPLUS_LIB
#ifndef HAVE_FDKAAC_LIB
throw Exception( __FILE__, __LINE__,
"DarkIce not compiled with AAC+ support, "
"thus can't aacplus stream: ",
Expand All @@ -1192,7 +1192,7 @@ DarkIce :: configFileCast ( const Config & config )
quality,
sampleRate,
dsp->getChannel());
#endif // HAVE_AACPLUS_LIB
#endif // HAVE_FDKAAC_LIB
} else {
throw Exception( __FILE__, __LINE__,
"Illegal stream format: ", format);
Expand Down
4 changes: 2 additions & 2 deletions darkice/trunk/src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ darkice_CXXFLAGS = \
$(OPUS_CFLAGS) \
$(FLAC_CFLAGS) \
$(FAAC_CFLAGS) \
$(AACPLUS_CFLAGS) \
$(FDKAAC_CFLAGS) \
$(TWOLAME_CFLAGS) \
$(ALSA_CFLAGS) \
$(PULSEAUDIO_CFLAGS) \
Expand All @@ -23,7 +23,7 @@ darkice_LDADD = \
$(OPUS_LIBS) \
$(FLAC_LIBS) \
$(FAAC_LIBS) \
$(AACPLUS_LIBS) \
$(FDKAAC_LIBS) \
$(TWOLAME_LIBS) \
$(ALSA_LIBS) \
$(PULSEAUDIO_LIBS) \
Expand Down
Loading

0 comments on commit a0be42f

Please sign in to comment.