[pulseaudio-commits] 8 commits - configure.ac src/Makefile.am src/modules src/pulsecore src/utils

Arun Raghavan arun at kemper.freedesktop.org
Mon Dec 12 19:49:26 PST 2011


 configure.ac                                 |   54 ++++++++++++++++++++++++---
 src/Makefile.am                              |   14 +++++--
 src/modules/echo-cancel/echo-cancel.h        |   11 +++++
 src/modules/echo-cancel/module-echo-cancel.c |   21 ++++++++--
 src/pulsecore/i18n.c                         |    3 +
 src/pulsecore/i18n.h                         |    4 +-
 src/pulsecore/iochannel.c                    |    2 +
 src/pulsecore/mime-type.c                    |    3 -
 src/pulsecore/proplist-util.c                |    3 +
 src/pulsecore/resampler.c                    |   47 +++++++++++++++++++++++
 src/utils/pacat.c                            |    2 +
 src/utils/pacmd.c                            |    2 +
 src/utils/pactl.c                            |    2 +
 src/utils/pasuspender.c                      |    2 +
 src/utils/qpaeq                              |    4 +-
 15 files changed, 151 insertions(+), 23 deletions(-)

New commits:
commit bb2e60a142ca0a2f95a168751073e17f7623a552
Author: Arun Raghavan <arun.raghavan at collabora.co.uk>
Date:   Tue Dec 13 09:16:40 2011 +0530

    utils: Typo fixes in qpaeq
    
    Pointed out by John Frankish <j-frankish at slb.com> in:
    
    https://bugs.freedesktop.org/show_bug.cgi?id=43733

diff --git a/src/utils/qpaeq b/src/utils/qpaeq
index 951e70f..5a7901e 100755
--- a/src/utils/qpaeq
+++ b/src/utils/qpaeq
@@ -23,8 +23,8 @@ try:
     import dbus.mainloop.qt
     import dbus
 except ImportError as e:
-    sys.stderr.write('There was an error importing need libraries\n'
-                     'Make sure you haveqt4 and dbus forthon installed\n'
+    sys.stderr.write('There was an error importing needed libraries\n'
+                     'Make sure you have qt4 and dbus-python installed\n'
                      'The error that occured was:\n'
                      '\t%s\n' % (str(e)))
     sys.exit(-1)

commit dc5a39b124b6dd605d88e8633bd93e3da1169c3d
Author: Peter Meerwald <p.meerwald at bct-electronic.com>
Date:   Sun Dec 11 16:07:42 2011 +0100

    echo-cance: Make Adrian canceller optional
    
    makes the Adrian echo canceller implementation optional at compile time
    
    this patch supersedes an earlier patch proposal and addresses the following
    comments:
    * separate patch from speex dependency rework (Arun)
    * check that at least one EC implementation is available (Arun)
    * properly align yes/no in configure summary for Adrian (Frederic)

diff --git a/configure.ac b/configure.ac
index dcf4b8f..af30fd3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1178,6 +1178,13 @@ AC_SUBST(WEBRTC_CFLAGS)
 AC_SUBST(WEBRTC_LIBS)
 AM_CONDITIONAL([HAVE_WEBRTC], [test "x$HAVE_WEBRTC" = "x1"])
 
+AC_ARG_ENABLE([adrian-aec],
+    AS_HELP_STRING([--enable-adrian-aec], [Enable Adrian's optional echo canceller]))
+AS_IF([test "x$enable_adrian_aec" != "xno"],
+    [HAVE_ADRIAN_EC=1])
+AM_CONDITIONAL([HAVE_ADRIAN_EC], [test "x$HAVE_ADRIAN_EC" = "x1"])
+
+
 
 ###################################
 #            Output               #
@@ -1324,6 +1331,7 @@ AS_IF([test "x$HAVE_IPV6" = "x1"], ENABLE_IPV6=yes, ENABLE_IPV6=no)
 AS_IF([test "x$HAVE_OPENSSL" = "x1"], ENABLE_OPENSSL=yes, ENABLE_OPENSSL=no)
 AS_IF([test "x$HAVE_FFTW" = "x1"], ENABLE_FFTW=yes, ENABLE_FFTW=no)
 AS_IF([test "x$HAVE_ORC" = "xyes"], ENABLE_ORC=yes, ENABLE_ORC=no)
+AS_IF([test "x$HAVE_ADRIAN_EC" = "x1"], ENABLE_ADRIAN_EC=yes, ENABLE_ADRIAN_EC=no)
 AS_IF([test "x$HAVE_SPEEX" = "x1"], ENABLE_SPEEX=yes, ENABLE_SPEEX=no)
 AS_IF([test "x$HAVE_WEBRTC" = "x1"], ENABLE_WEBRTC=yes, ENABLE_WEBRTC=no)
 AS_IF([test "x$HAVE_TDB" = "x1"], ENABLE_TDB=yes, ENABLE_TDB=no)
@@ -1372,7 +1380,8 @@ echo "
     Enable OpenSSL (for Airtunes): ${ENABLE_OPENSSL}
     Enable fftw:                   ${ENABLE_FFTW}
     Enable orc:                    ${ENABLE_ORC}
-    Enable speex:                  ${ENABLE_SPEEX}
+    Enable Adrian echo canceller:  ${ENABLE_ADRIAN_EC}
+    Enable speex (resampler, AEC): ${ENABLE_SPEEX}
     Enable WebRTC echo canceller:  ${ENABLE_WEBRTC}
     Database
       tdb:                         ${ENABLE_TDB}
@@ -1390,6 +1399,10 @@ echo "
     Legacy Database Entry Support: ${ENABLE_LEGACY_DATABASE_ENTRY_FORMAT}
 "
 
+if test "${ENABLE_SPEEX}" = "no" && test "${ENABLE_WEBRTC}" = "no" && test "${ENABLE_ADRIAN_EC}" = "no" ; then
+AC_MSG_ERROR([At least one echo canceller implementation must be available.])
+fi
+
 if test "${ENABLE_DBUS}" = "no" && test "x$os_is_win32" != "x1" ; then
    echo "
 ===== WARNING WARNING WARNING WARNING WARNING WARNING WARNING =====
diff --git a/src/Makefile.am b/src/Makefile.am
index 852e962..649f82f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1744,12 +1744,15 @@ module_suspend_on_idle_la_CFLAGS = $(AM_CFLAGS)
 
 # echo-cancel module
 module_echo_cancel_la_SOURCES = \
-		modules/echo-cancel/module-echo-cancel.c modules/echo-cancel/echo-cancel.h \
-		modules/echo-cancel/adrian-aec.c modules/echo-cancel/adrian-aec.h \
-		modules/echo-cancel/adrian.c modules/echo-cancel/adrian.h
+		modules/echo-cancel/module-echo-cancel.c modules/echo-cancel/echo-cancel.h
 module_echo_cancel_la_LDFLAGS = $(MODULE_LDFLAGS)
 module_echo_cancel_la_LIBADD = $(MODULE_LIBADD) $(LIBSPEEX_LIBS)
 module_echo_cancel_la_CFLAGS = $(AM_CFLAGS) $(SERVER_CFLAGS) $(LIBSPEEX_CFLAGS)
+if HAVE_ADRIAN_EC
+module_echo_cancel_la_SOURCES += \
+		modules/echo-cancel/adrian-aec.c modules/echo-cancel/adrian-aec.h \
+		modules/echo-cancel/adrian.c modules/echo-cancel/adrian.h
+module_echo_cancel_la_CFLAGS += -DHAVE_ADRIAN_EC=1
 if HAVE_ORC
 ORC_SOURCE += modules/echo-cancel/adrian-aec
 nodist_module_echo_cancel_la_SOURCES = \
@@ -1758,6 +1761,7 @@ nodist_module_echo_cancel_la_SOURCES = \
 module_echo_cancel_la_LIBADD += $(ORC_LIBS)
 module_echo_cancel_la_CFLAGS += $(ORC_CFLAGS) -I$(top_builddir)/src/modules/echo-cancel
 endif
+endif
 if HAVE_SPEEX
 module_echo_cancel_la_SOURCES += modules/echo-cancel/speex.c
 endif
diff --git a/src/modules/echo-cancel/echo-cancel.h b/src/modules/echo-cancel/echo-cancel.h
index 15d44f5..870d163 100644
--- a/src/modules/echo-cancel/echo-cancel.h
+++ b/src/modules/echo-cancel/echo-cancel.h
@@ -52,10 +52,12 @@ struct pa_echo_canceller_params {
             SpeexPreprocessState *pp_state;
         } speex;
 #endif
+#ifdef HAVE_ADRIAN_EC
         struct {
             uint32_t blocksize;
             AEC *aec;
         } adrian;
+#endif
 #ifdef HAVE_WEBRTC
         struct {
             /* This is a void* so that we don't have to convert this whole file
@@ -136,6 +138,7 @@ void pa_speex_ec_run(pa_echo_canceller *ec, const uint8_t *rec, const uint8_t *p
 void pa_speex_ec_done(pa_echo_canceller *ec);
 #endif
 
+#ifdef HAVE_ADRIAN_EC
 /* Adrian Andre's echo canceller */
 pa_bool_t pa_adrian_ec_init(pa_core *c, pa_echo_canceller *ec,
                            pa_sample_spec *source_ss, pa_channel_map *source_map,
@@ -143,6 +146,7 @@ pa_bool_t pa_adrian_ec_init(pa_core *c, pa_echo_canceller *ec,
                            uint32_t *blocksize, const char *args);
 void pa_adrian_ec_run(pa_echo_canceller *ec, const uint8_t *rec, const uint8_t *play, uint8_t *out);
 void pa_adrian_ec_done(pa_echo_canceller *ec);
+#endif
 
 #ifdef HAVE_WEBRTC
 /* WebRTC canceller functions */
diff --git a/src/modules/echo-cancel/module-echo-cancel.c b/src/modules/echo-cancel/module-echo-cancel.c
index 9f3e85c..5c7bb78 100644
--- a/src/modules/echo-cancel/module-echo-cancel.c
+++ b/src/modules/echo-cancel/module-echo-cancel.c
@@ -85,7 +85,9 @@ typedef enum {
 #ifdef HAVE_SPEEX
     PA_ECHO_CANCELLER_SPEEX,
 #endif
+#ifdef HAVE_ADRIAN_EC
     PA_ECHO_CANCELLER_ADRIAN,
+#endif
 #ifdef HAVE_WEBRTC
     PA_ECHO_CANCELLER_WEBRTC,
 #endif
@@ -106,12 +108,14 @@ static const pa_echo_canceller ec_table[] = {
         .done                   = pa_speex_ec_done,
     },
 #endif
+#ifdef HAVE_ADRIAN_EC
     {
         /* Adrian Andre's NLMS implementation */
         .init                   = pa_adrian_ec_init,
         .run                    = pa_adrian_ec_run,
         .done                   = pa_adrian_ec_done,
     },
+#endif
 #ifdef HAVE_WEBRTC
     {
         /* WebRTC's audio processing engine */
@@ -1549,8 +1553,10 @@ static pa_echo_canceller_method_t get_ec_method_from_string(const char *method)
     if (pa_streq(method, "speex"))
         return PA_ECHO_CANCELLER_SPEEX;
 #endif
+#ifdef HAVE_ADRIAN_EC
     if (pa_streq(method, "adrian"))
         return PA_ECHO_CANCELLER_ADRIAN;
+#endif
 #ifdef HAVE_WEBRTC
     if (pa_streq(method, "webrtc"))
         return PA_ECHO_CANCELLER_WEBRTC;

commit 5f2286e6f76ab9fbf83a92c17b48b537d9d59026
Author: Peter Meerwald <p.meerwald at bct-electronic.com>
Date:   Sun Dec 11 16:07:41 2011 +0100

    build-sys: Make speex library optional
    
    make speex library dependency optional, this affects the resampler
    and the echo canceller module
    
    this patch supersedes an earlier patch proposal and addresses the following
    comments:
    * fix order of pa_echo_canceller_method_t enum and ec_table (Frederic)
    * the default resampler is speex if available as before, otherwise ffmpeg (Arun)
    * does not touch the Adrian EC implementation (see separate patch) (Arun)

diff --git a/configure.ac b/configure.ac
index ab39249..dcf4b8f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -586,10 +586,6 @@ PKG_CHECK_MODULES(LIBSNDFILE, [ sndfile >= 1.0.20 ])
 AC_SUBST(LIBSNDFILE_CFLAGS)
 AC_SUBST(LIBSNDFILE_LIBS)
 
-PKG_CHECK_MODULES(LIBSPEEX, [ speexdsp >= 1.2 ])
-AC_SUBST(LIBSPEEX_CFLAGS)
-AC_SUBST(LIBSPEEX_LIBS)
-
 #### atomic-ops ####
 
 AC_MSG_CHECKING([whether we need libatomic_ops])
@@ -1053,6 +1049,24 @@ AS_IF([test "x$with_fftw" = "xyes" && test "x$HAVE_FFTW" = "x0"],
 
 AM_CONDITIONAL([HAVE_FFTW], [test "x$HAVE_FFTW" = "x1"])
 
+#### speex (optional) ####
+
+AC_ARG_WITH([speex],
+    AS_HELP_STRING([--without-speex],[Omit speex (resampling, AEC)]))
+
+AS_IF([test "x$with_speex" != "xno"],
+    [PKG_CHECK_MODULES(LIBSPEEX, [ speexdsp >= 1.2 ], HAVE_SPEEX=1, HAVE_SPEEX=0)],
+    HAVE_SPEEX=0)
+
+AS_IF([test "x$with_speex" = "xyes" && test "x$HAVE_SPEEX" = "x0"],
+    [AC_MSG_ERROR([*** speex support not found])])
+
+AM_CONDITIONAL([HAVE_SPEEX], [test "x$HAVE_SPEEX" = "x1"])
+AS_IF([test "x$HAVE_SPEEX" = "x1"], AC_DEFINE([HAVE_SPEEX], 1, [Have speex]))
+
+AC_SUBST(LIBSPEEX_CFLAGS)
+AC_SUBST(LIBSPEEX_LIBS)
+
 #### ORC (optional) ####
 
 ORC_CHECK([0.4.11])
@@ -1310,6 +1324,7 @@ AS_IF([test "x$HAVE_IPV6" = "x1"], ENABLE_IPV6=yes, ENABLE_IPV6=no)
 AS_IF([test "x$HAVE_OPENSSL" = "x1"], ENABLE_OPENSSL=yes, ENABLE_OPENSSL=no)
 AS_IF([test "x$HAVE_FFTW" = "x1"], ENABLE_FFTW=yes, ENABLE_FFTW=no)
 AS_IF([test "x$HAVE_ORC" = "xyes"], ENABLE_ORC=yes, ENABLE_ORC=no)
+AS_IF([test "x$HAVE_SPEEX" = "x1"], ENABLE_SPEEX=yes, ENABLE_SPEEX=no)
 AS_IF([test "x$HAVE_WEBRTC" = "x1"], ENABLE_WEBRTC=yes, ENABLE_WEBRTC=no)
 AS_IF([test "x$HAVE_TDB" = "x1"], ENABLE_TDB=yes, ENABLE_TDB=no)
 AS_IF([test "x$HAVE_GDBM" = "x1"], ENABLE_GDBM=yes, ENABLE_GDBM=no)
@@ -1357,6 +1372,7 @@ echo "
     Enable OpenSSL (for Airtunes): ${ENABLE_OPENSSL}
     Enable fftw:                   ${ENABLE_FFTW}
     Enable orc:                    ${ENABLE_ORC}
+    Enable speex:                  ${ENABLE_SPEEX}
     Enable WebRTC echo canceller:  ${ENABLE_WEBRTC}
     Database
       tdb:                         ${ENABLE_TDB}
@@ -1397,3 +1413,14 @@ and is thus a critical part of PulseAudio on that platform.
 ===== WARNING WARNING WARNING WARNING WARNING WARNING WARNING =====
 "
 fi
+
+if test "${ENABLE_SPEEX}" = "no" && test "x$os_is_win32" != "x1" ; then
+   echo "
+===== WARNING WARNING WARNING WARNING WARNING WARNING WARNING =====
+You do not have speex support enabled. It is strongly recommended
+that you enable speex support if your platform supports it as it is
+the primary method used for audio resampling and is thus a critical
+part of PulseAudio on that platform.
+===== WARNING WARNING WARNING WARNING WARNING WARNING WARNING =====
+"
+fi
diff --git a/src/Makefile.am b/src/Makefile.am
index 8a44b19..852e962 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1745,7 +1745,6 @@ module_suspend_on_idle_la_CFLAGS = $(AM_CFLAGS)
 # echo-cancel module
 module_echo_cancel_la_SOURCES = \
 		modules/echo-cancel/module-echo-cancel.c modules/echo-cancel/echo-cancel.h \
-		modules/echo-cancel/speex.c \
 		modules/echo-cancel/adrian-aec.c modules/echo-cancel/adrian-aec.h \
 		modules/echo-cancel/adrian.c modules/echo-cancel/adrian.h
 module_echo_cancel_la_LDFLAGS = $(MODULE_LDFLAGS)
@@ -1759,6 +1758,9 @@ nodist_module_echo_cancel_la_SOURCES = \
 module_echo_cancel_la_LIBADD += $(ORC_LIBS)
 module_echo_cancel_la_CFLAGS += $(ORC_CFLAGS) -I$(top_builddir)/src/modules/echo-cancel
 endif
+if HAVE_SPEEX
+module_echo_cancel_la_SOURCES += modules/echo-cancel/speex.c
+endif
 if HAVE_WEBRTC
 module_echo_cancel_la_SOURCES += modules/echo-cancel/webrtc.cc
 module_echo_cancel_la_CFLAGS += -DHAVE_WEBRTC=1
diff --git a/src/modules/echo-cancel/echo-cancel.h b/src/modules/echo-cancel/echo-cancel.h
index bc1aab1..15d44f5 100644
--- a/src/modules/echo-cancel/echo-cancel.h
+++ b/src/modules/echo-cancel/echo-cancel.h
@@ -31,8 +31,11 @@
 #include <pulsecore/core.h>
 #include <pulsecore/macro.h>
 
+#ifdef HAVE_SPEEX
 #include <speex/speex_echo.h>
 #include <speex/speex_preprocess.h>
+#endif
+
 #include "adrian.h"
 
 /* Common data structures */
@@ -43,10 +46,12 @@ typedef struct pa_echo_canceller_params pa_echo_canceller_params;
 
 struct pa_echo_canceller_params {
     union {
+#ifdef HAVE_SPEEX
         struct {
             SpeexEchoState *state;
             SpeexPreprocessState *pp_state;
         } speex;
+#endif
         struct {
             uint32_t blocksize;
             AEC *aec;
@@ -121,6 +126,7 @@ struct pa_echo_canceller {
 void pa_echo_canceller_get_capture_volume(pa_echo_canceller *ec, pa_cvolume *v);
 void pa_echo_canceller_set_capture_volume(pa_echo_canceller *ec, pa_cvolume *v);
 
+#ifdef HAVE_SPEEX
 /* Speex canceller functions */
 pa_bool_t pa_speex_ec_init(pa_core *c, pa_echo_canceller *ec,
                            pa_sample_spec *source_ss, pa_channel_map *source_map,
@@ -128,6 +134,7 @@ pa_bool_t pa_speex_ec_init(pa_core *c, pa_echo_canceller *ec,
                            uint32_t *blocksize, const char *args);
 void pa_speex_ec_run(pa_echo_canceller *ec, const uint8_t *rec, const uint8_t *play, uint8_t *out);
 void pa_speex_ec_done(pa_echo_canceller *ec);
+#endif
 
 /* Adrian Andre's echo canceller */
 pa_bool_t pa_adrian_ec_init(pa_core *c, pa_echo_canceller *ec,
diff --git a/src/modules/echo-cancel/module-echo-cancel.c b/src/modules/echo-cancel/module-echo-cancel.c
index 8bf6670..9f3e85c 100644
--- a/src/modules/echo-cancel/module-echo-cancel.c
+++ b/src/modules/echo-cancel/module-echo-cancel.c
@@ -82,7 +82,9 @@ PA_MODULE_USAGE(
 /* NOTE: Make sure the enum and ec_table are maintained in the correct order */
 typedef enum {
     PA_ECHO_CANCELLER_INVALID = -1,
-    PA_ECHO_CANCELLER_SPEEX = 0,
+#ifdef HAVE_SPEEX
+    PA_ECHO_CANCELLER_SPEEX,
+#endif
     PA_ECHO_CANCELLER_ADRIAN,
 #ifdef HAVE_WEBRTC
     PA_ECHO_CANCELLER_WEBRTC,
@@ -96,12 +98,14 @@ typedef enum {
 #endif
 
 static const pa_echo_canceller ec_table[] = {
+#ifdef HAVE_SPEEX
     {
         /* Speex */
         .init                   = pa_speex_ec_init,
         .run                    = pa_speex_ec_run,
         .done                   = pa_speex_ec_done,
     },
+#endif
     {
         /* Adrian Andre's NLMS implementation */
         .init                   = pa_adrian_ec_init,
@@ -1541,16 +1545,17 @@ void pa_echo_canceller_set_capture_volume(pa_echo_canceller *ec, pa_cvolume *v)
 }
 
 static pa_echo_canceller_method_t get_ec_method_from_string(const char *method) {
+#ifdef HAVE_SPEEX
     if (pa_streq(method, "speex"))
         return PA_ECHO_CANCELLER_SPEEX;
-    else if (pa_streq(method, "adrian"))
+#endif
+    if (pa_streq(method, "adrian"))
         return PA_ECHO_CANCELLER_ADRIAN;
 #ifdef HAVE_WEBRTC
-    else if (pa_streq(method, "webrtc"))
+    if (pa_streq(method, "webrtc"))
         return PA_ECHO_CANCELLER_WEBRTC;
 #endif
-    else
-        return PA_ECHO_CANCELLER_INVALID;
+    return PA_ECHO_CANCELLER_INVALID;
 }
 
 /* Common initialisation bits between module-echo-cancel and the standalone test program */
diff --git a/src/pulsecore/resampler.c b/src/pulsecore/resampler.c
index 3cee06f..b56c1f5 100644
--- a/src/pulsecore/resampler.c
+++ b/src/pulsecore/resampler.c
@@ -29,7 +29,9 @@
 #include <samplerate.h>
 #endif
 
+#ifdef HAVE_SPEEX
 #include <speex/speex_resampler.h>
+#endif
 
 #include <pulse/xmalloc.h>
 #include <pulsecore/sconv.h>
@@ -90,9 +92,11 @@ struct pa_resampler {
     } src;
 #endif
 
+#ifdef HAVE_SPEEX
     struct { /* data specific to speex */
         SpeexResamplerState* state;
     } speex;
+#endif
 
     struct { /* data specific to ffmpeg */
         struct AVResampleContext *state;
@@ -102,7 +106,9 @@ struct pa_resampler {
 
 static int copy_init(pa_resampler *r);
 static int trivial_init(pa_resampler*r);
+#ifdef HAVE_SPEEX
 static int speex_init(pa_resampler*r);
+#endif
 static int ffmpeg_init(pa_resampler*r);
 static int peaks_init(pa_resampler*r);
 #ifdef HAVE_LIBSAMPLERATE
@@ -126,6 +132,7 @@ static int (* const init_table[])(pa_resampler*r) = {
     [PA_RESAMPLER_SRC_LINEAR]              = NULL,
 #endif
     [PA_RESAMPLER_TRIVIAL]                 = trivial_init,
+#ifdef HAVE_SPEEX
     [PA_RESAMPLER_SPEEX_FLOAT_BASE+0]      = speex_init,
     [PA_RESAMPLER_SPEEX_FLOAT_BASE+1]      = speex_init,
     [PA_RESAMPLER_SPEEX_FLOAT_BASE+2]      = speex_init,
@@ -148,6 +155,30 @@ static int (* const init_table[])(pa_resampler*r) = {
     [PA_RESAMPLER_SPEEX_FIXED_BASE+8]      = speex_init,
     [PA_RESAMPLER_SPEEX_FIXED_BASE+9]      = speex_init,
     [PA_RESAMPLER_SPEEX_FIXED_BASE+10]     = speex_init,
+#else
+    [PA_RESAMPLER_SPEEX_FLOAT_BASE+0]      = NULL,
+    [PA_RESAMPLER_SPEEX_FLOAT_BASE+1]      = NULL,
+    [PA_RESAMPLER_SPEEX_FLOAT_BASE+2]      = NULL,
+    [PA_RESAMPLER_SPEEX_FLOAT_BASE+3]      = NULL,
+    [PA_RESAMPLER_SPEEX_FLOAT_BASE+4]      = NULL,
+    [PA_RESAMPLER_SPEEX_FLOAT_BASE+5]      = NULL,
+    [PA_RESAMPLER_SPEEX_FLOAT_BASE+6]      = NULL,
+    [PA_RESAMPLER_SPEEX_FLOAT_BASE+7]      = NULL,
+    [PA_RESAMPLER_SPEEX_FLOAT_BASE+8]      = NULL,
+    [PA_RESAMPLER_SPEEX_FLOAT_BASE+9]      = NULL,
+    [PA_RESAMPLER_SPEEX_FLOAT_BASE+10]     = NULL,
+    [PA_RESAMPLER_SPEEX_FIXED_BASE+0]      = NULL,
+    [PA_RESAMPLER_SPEEX_FIXED_BASE+1]      = NULL,
+    [PA_RESAMPLER_SPEEX_FIXED_BASE+2]      = NULL,
+    [PA_RESAMPLER_SPEEX_FIXED_BASE+3]      = NULL,
+    [PA_RESAMPLER_SPEEX_FIXED_BASE+4]      = NULL,
+    [PA_RESAMPLER_SPEEX_FIXED_BASE+5]      = NULL,
+    [PA_RESAMPLER_SPEEX_FIXED_BASE+6]      = NULL,
+    [PA_RESAMPLER_SPEEX_FIXED_BASE+7]      = NULL,
+    [PA_RESAMPLER_SPEEX_FIXED_BASE+8]      = NULL,
+    [PA_RESAMPLER_SPEEX_FIXED_BASE+9]      = NULL,
+    [PA_RESAMPLER_SPEEX_FIXED_BASE+10]     = NULL,
+#endif
     [PA_RESAMPLER_FFMPEG]                  = ffmpeg_init,
     [PA_RESAMPLER_AUTO]                    = NULL,
     [PA_RESAMPLER_COPY]                    = copy_init,
@@ -195,8 +226,13 @@ pa_resampler* pa_resampler_new(
         method = PA_RESAMPLER_AUTO;
     }
 
-    if (method == PA_RESAMPLER_AUTO)
+    if (method == PA_RESAMPLER_AUTO) {
+#ifdef HAVE_SPEEX
         method = PA_RESAMPLER_SPEEX_FLOAT_BASE + 3;
+#else
+        method = PA_RESAMPLER_FFMPEG;
+#endif
+    }
 
     r = pa_xnew(pa_resampler, 1);
     r->mempool = pool;
@@ -476,6 +512,13 @@ int pa_resample_method_supported(pa_resample_method_t m) {
         return 0;
 #endif
 
+#ifndef HAVE_SPEEX
+    if (m >= PA_RESAMPLER_SPEEX_FLOAT_BASE && m <= PA_RESAMPLER_SPEEX_FLOAT_MAX)
+        return 0;
+    if (m >= PA_RESAMPLER_SPEEX_FIXED_BASE && m <= PA_RESAMPLER_SPEEX_FIXED_MAX)
+        return 0;
+#endif
+
     return 1;
 }
 
@@ -1271,6 +1314,7 @@ static int libsamplerate_init(pa_resampler *r) {
 }
 #endif
 
+#ifdef HAVE_SPEEX
 /*** speex based implementation ***/
 
 static void speex_resample_float(pa_resampler *r, const pa_memchunk *input, unsigned in_n_frames, pa_memchunk *output, unsigned *out_n_frames) {
@@ -1364,6 +1408,7 @@ static int speex_init(pa_resampler *r) {
 
     return 0;
 }
+#endif
 
 /* Trivial implementation */
 

commit 87e6f489a96f324ff5f5c22f90dfd0ca260412ae
Author: Arun Raghavan <arun.raghavan at collabora.co.uk>
Date:   Fri Dec 9 21:00:11 2011 +0530

    utils: Fixes for building without NLS

diff --git a/src/utils/pacat.c b/src/utils/pacat.c
index 3c8e3c7..ec360f7 100644
--- a/src/utils/pacat.c
+++ b/src/utils/pacat.c
@@ -752,7 +752,9 @@ int main(int argc, char *argv[]) {
     };
 
     setlocale(LC_ALL, "");
+#ifdef ENABLE_NLS
     bindtextdomain(GETTEXT_PACKAGE, PULSE_LOCALEDIR);
+#endif
 
     bn = pa_path_get_filename(argv[0]);
 
diff --git a/src/utils/pacmd.c b/src/utils/pacmd.c
index 4166964..6d4cc9b 100644
--- a/src/utils/pacmd.c
+++ b/src/utils/pacmd.c
@@ -57,7 +57,9 @@ int main(int argc, char*argv[]) {
     int stdin_type = 0, stdout_type = 0, fd_type = 0;
 
     setlocale(LC_ALL, "");
+#ifdef ENABLE_NLS
     bindtextdomain(GETTEXT_PACKAGE, PULSE_LOCALEDIR);
+#endif
 
     if (pa_pid_file_check_running(&pid, "pulseaudio") < 0) {
         pa_log(_("No PulseAudio daemon running, or not running as session daemon."));
diff --git a/src/utils/pactl.c b/src/utils/pactl.c
index 53017d6..bf16534 100644
--- a/src/utils/pactl.c
+++ b/src/utils/pactl.c
@@ -1361,7 +1361,9 @@ int main(int argc, char *argv[]) {
     };
 
     setlocale(LC_ALL, "");
+#ifdef ENABLE_NLS
     bindtextdomain(GETTEXT_PACKAGE, PULSE_LOCALEDIR);
+#endif
 
     bn = pa_path_get_filename(argv[0]);
 
diff --git a/src/utils/pasuspender.c b/src/utils/pasuspender.c
index 90881b2..0a60923 100644
--- a/src/utils/pasuspender.c
+++ b/src/utils/pasuspender.c
@@ -231,7 +231,9 @@ int main(int argc, char *argv[]) {
     };
 
     setlocale(LC_ALL, "");
+#ifdef ENABLE_NLS
     bindtextdomain(GETTEXT_PACKAGE, PULSE_LOCALEDIR);
+#endif
 
     bn = pa_path_get_filename(argv[0]);
 

commit 99afd6adefb341d029f5e243cd35115dd9bb2a52
Author: Arun Raghavan <arun.raghavan at collabora.co.uk>
Date:   Thu Dec 8 14:29:06 2011 +0530

    iochannel: Handle missing un.h correctly

diff --git a/src/pulsecore/iochannel.c b/src/pulsecore/iochannel.c
index 4b0fb3a..fa3d767 100644
--- a/src/pulsecore/iochannel.c
+++ b/src/pulsecore/iochannel.c
@@ -255,7 +255,9 @@ ssize_t pa_iochannel_read(pa_iochannel*io, void*data, size_t l) {
 pa_bool_t pa_iochannel_creds_supported(pa_iochannel *io) {
     struct {
         struct sockaddr sa;
+#ifdef HAVE_SYS_UN_H
         struct sockaddr_un un;
+#endif
         struct sockaddr_storage storage;
     } sa;
 

commit 10deb4093c223e24b3a21eded11630fd63ac6e65
Author: Arun Raghavan <arun.raghavan at collabora.co.uk>
Date:   Thu Dec 8 14:19:50 2011 +0530

    mime: Move assert to correct position

diff --git a/src/pulsecore/mime-type.c b/src/pulsecore/mime-type.c
index b9fe944..09ce00b 100644
--- a/src/pulsecore/mime-type.c
+++ b/src/pulsecore/mime-type.c
@@ -145,6 +145,7 @@ void pa_sample_spec_mimefy(pa_sample_spec *ss, pa_channel_map *cm) {
 
 char *pa_sample_spec_to_mime_type(const pa_sample_spec *ss, const pa_channel_map *cm) {
     pa_assert(pa_channel_map_compatible(cm, ss));
+    pa_assert(pa_sample_spec_valid(ss));
 
     if (!pa_sample_spec_is_mime(ss, cm))
         return NULL;
@@ -168,8 +169,6 @@ char *pa_sample_spec_to_mime_type(const pa_sample_spec *ss, const pa_channel_map
         default:
             pa_assert_not_reached();
     }
-
-    pa_assert(pa_sample_spec_valid(ss));
 }
 
 char *pa_sample_spec_to_mime_type_mimefy(const pa_sample_spec *_ss, const pa_channel_map *_cm) {

commit c55648ce6c10f60b942efff8d1c503793ef77f07
Author: Arun Raghavan <arun.raghavan at collabora.co.uk>
Date:   Thu Dec 8 14:17:07 2011 +0530

    build-sys: Use absolute path for map-file while linking
    
    This makes the link process more robust in some stranger configurations.

diff --git a/configure.ac b/configure.ac
index fbc7276..ab39249 100644
--- a/configure.ac
+++ b/configure.ac
@@ -168,8 +168,8 @@ AS_CASE([" $CFLAGS "], [*" -O0 "*], [], [AX_APPEND_FLAG(["-DFASTPATH"], [CPPFLAG
 # Check whether the linker supports the -version-script option.
 # The Make variable $(srcdir) needs to be in the LDFLAGS in that form,
 # so that it is expanded the right way in every subdir.
-AX_CHECK_LINK_FLAG(["-Wl,-version-script=${srcdir}/src/map-file"],
-    [VERSIONING_LDFLAGS='-Wl,-version-script=$(srcdir)/map-file'])
+AX_CHECK_LINK_FLAG(["-Wl,-version-script=${abs_top_srcdir}/src/map-file"],
+    [VERSIONING_LDFLAGS='-Wl,-version-script=$(abs_top_srcdir)/map-file'])
 AC_SUBST([VERSIONING_LDFLAGS])
 
 # Use immediate (now) bindings; avoids the funky re-call in itself.

commit 30d6303abff107ea0661af8cf2ae4e0abad8d73e
Author: Arun Raghavan <arun.raghavan at collabora.co.uk>
Date:   Thu Dec 8 14:15:06 2011 +0530

    build-sys: Fix building without NLS

diff --git a/configure.ac b/configure.ac
index e3ce987..fbc7276 100644
--- a/configure.ac
+++ b/configure.ac
@@ -95,6 +95,7 @@ PKG_PROG_PKG_CONFIG
 
 # gettext
 
+if test "x$enable_nls" != "xno"; then
 IT_PROG_INTLTOOL([0.35.0])
 GETTEXT_PACKAGE=pulseaudio
 AC_SUBST([GETTEXT_PACKAGE])
@@ -103,6 +104,7 @@ AM_GLIB_GNU_GETTEXT
 
 pulselocaledir='${prefix}/${DATADIRNAME}/locale'
 AX_DEFINE_DIR(PULSE_LOCALEDIR, pulselocaledir, [Gettext locale dir])
+fi
 
 
 #### Determine host OS ####
diff --git a/src/pulsecore/i18n.c b/src/pulsecore/i18n.c
index 7f25b20..b4f0a66 100644
--- a/src/pulsecore/i18n.c
+++ b/src/pulsecore/i18n.c
@@ -28,11 +28,12 @@
 #include "i18n.h"
 
 void pa_init_i18n(void) {
-
+#ifdef ENABLE_NLS
     PA_ONCE_BEGIN {
 
         bindtextdomain(GETTEXT_PACKAGE, PULSE_LOCALEDIR);
         bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
 
     } PA_ONCE_END;
+#endif
 }
diff --git a/src/pulsecore/i18n.h b/src/pulsecore/i18n.h
index d828bec..b206867 100644
--- a/src/pulsecore/i18n.h
+++ b/src/pulsecore/i18n.h
@@ -26,12 +26,12 @@
 
 PA_C_DECL_BEGIN
 
+#ifdef ENABLE_NLS
+
 #if !defined(GETTEXT_PACKAGE)
 #error "Something is very wrong here, config.h needs to be included first"
 #endif
 
-#ifdef ENABLE_NLS
-
 #include <libintl.h>
 
 #define _(String) dgettext(GETTEXT_PACKAGE, String)
diff --git a/src/pulsecore/proplist-util.c b/src/pulsecore/proplist-util.c
index bec857a..f447431 100644
--- a/src/pulsecore/proplist-util.c
+++ b/src/pulsecore/proplist-util.c
@@ -25,7 +25,10 @@
 
 #include <string.h>
 #include <locale.h>
+
+#ifdef ENABLE_NLS
 #include <libintl.h>
+#endif
 
 #ifdef __APPLE__
 #include <crt_externs.h>



More information about the pulseaudio-commits mailing list