Commit 949741f1 authored by sflphone's avatar sflphone
Browse files

Use libspeexdsp only if available version 2

parent 6421269d
......@@ -223,7 +223,6 @@ AC_ARG_WITH([speex],
[],
[with_speex=yes])
LIBSPEEX=
AS_IF([test "x$with_speex" != xno],
[AC_CHECK_HEADER([speex/speex.h], , AC_MSG_FAILURE([Unable to find the libspeex headers (you may need to install the dev package). You may use --without-speex to compile without speex codec support.]))]
[AC_CHECK_HEADER([speex/speex_preprocess.h], , AC_MSG_FAILURE([Unable to find the libspeexdsp headers (you may need to install the libspeexdsp-dev package). You may use --without-speex to compile without speex codec support.]))]
......@@ -234,12 +233,17 @@ AS_IF([test "x$with_speex" != xno],
)
]
dnl More advanced check in case the libspeexdsp is not installed
AC_CHECK_LIB(speex, speex_preprocess_run, [AC_DEFINE(HAVE_SPEEX_DSP)])
AC_CHECK_LIB(speex, speex_preprocess_run, HAVE_SPEEXDSP=true, HAVE_SPEEXDSP=false)
if test $HAVE_SPEEXDSP = false; then
AC_MSG_WARN([The silence detection in speex could not have been enabled])
fi
)
AC_DEFINE([HAVE_SPEEX], test "x$with_speex" = "xyes", [Define if you have libspeex])
AM_CONDITIONAL(BUILD_SPEEX, test "x$with_speex" = "xyes" )
AM_CONDITIONAL(HAVE_SPEEX_DSP, $(HAVE_SPEEX_DSP))
AM_CONDITIONAL(ENABLE_SPEEXDSP, $HAVE_SPEEXDSP)
dnl Check for ilbc support
AC_ARG_WITH([ilbc],
......
......@@ -9,16 +9,16 @@ libcodec_gsm_so_LDFLAGS = --shared -lc -lgsm
INSTALL_GSM_RULE = install-libcodec_gsm_so
endif
if ENABLE_SPEEXDSP
SPEEXDSP_LIB = -lspeexdsp
endif
if BUILD_SPEEX
SPEEX_LIB = libcodec_speex.so
SPEEX_DSP_LIB=
if HAVE_SPEEX_DSP
SPEEX_DSP_LIB = -lspeexdsp
endif
libcodec_speex_so_SOURCES = speexcodec.cpp
libcodec_speex_so_CFLAGS = -fPIC -g -Wall
libcodec_speex_so_CXXFLAGS = -fPIC -g -Wall
libcodec_speex_so_LDFLAGS = --shared -lc -lspeex $(SPEEX_DSP_LIB) -lm
libcodec_speex_so_LDFLAGS = --shared -lc -lspeex $(SPEEXDSP_LIB) -lm
INSTALL_SPEEX_RULE = install-libcodec_speex_so
endif
......
......@@ -59,7 +59,7 @@ class Speex : public AudioCodec{
speex_bits_init(&_speex_enc_bits);
_speex_enc_state = speex_encoder_init(_speexModePtr);
#ifdef HAVE_SPEEX_DSP
#if ENABLE_SPEEXDSP
int enable = 1;
int quality = 10;
......@@ -114,7 +114,7 @@ class Speex : public AudioCodec{
{
speex_bits_reset(&_speex_enc_bits);
#ifdef HAVE_SPEEX_DSP
#if ENABLE_SPEEXDSP
speex_encoder_ctl(_speex_enc_state,SPEEX_SET_SAMPLING_RATE,&_clockRate);
speex_preprocess_run(_preprocess_state, src);
#endif
......
Supports Markdown
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