diff --git a/configure.ac b/configure.ac index 31cb9b7870..31b5c514c5 100644 --- a/configure.ac +++ b/configure.ac @@ -1172,6 +1172,11 @@ AG_GST_CHECK_FEATURE(SOUNDTOUCH, [soundtouch plug-in], soundtouch, [ [PKG_CHECK_MODULES(SOUNDTOUCH, libSoundTouch, HAVE_SOUNDTOUCH=yes, HAVE_SOUNDTOUCH=no)]) + dnl We only need -lBPM on soundtouch < 1.4 + PKG_CHECK_EXISTS(libSoundTouch >= 1.4, + AC_DEFINE([HAVE_SOUNDTOUCH_1_4], [1], + [Defined if the available libSoundTouch is >= 1.4]), + SOUNDTOUCH_CFLAGS="$SOUNDTOUCH_CFLAGS -lBPM") AC_SUBST(SOUNDTOUCH_CFLAGS) AC_SUBST(SOUNDTOUCH_LIBS) if test "x$HAVE_CXX" != "xyes"; then diff --git a/ext/soundtouch/Makefile.am b/ext/soundtouch/Makefile.am index 0c4ec8265e..bd23cdce70 100644 --- a/ext/soundtouch/Makefile.am +++ b/ext/soundtouch/Makefile.am @@ -7,7 +7,7 @@ libgstsoundtouch_la_SOURCES = \ libgstsoundtouch_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(SOUNDTOUCH_CFLAGS) libgstsoundtouch_la_CXXFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CXXFLAGS) $(SOUNDTOUCH_CFLAGS) -libgstsoundtouch_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) -lgstaudio-$(GST_MAJORMINOR) $(GST_BASE_LIBS) $(GST_CONTROLLER_LIBS) $(GST_LIBS) $(SOUNDTOUCH_LIBS) -lBPM $(LIBM) +libgstsoundtouch_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) -lgstaudio-$(GST_MAJORMINOR) $(GST_BASE_LIBS) $(GST_CONTROLLER_LIBS) $(GST_LIBS) $(SOUNDTOUCH_LIBS) -lm libgstsoundtouch_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) libgstsoundtouch_la_LIBTOOLFLAGS = --tag=disable-static diff --git a/ext/soundtouch/gstbpmdetect.cc b/ext/soundtouch/gstbpmdetect.cc index 8d77430361..23dfc18528 100644 --- a/ext/soundtouch/gstbpmdetect.cc +++ b/ext/soundtouch/gstbpmdetect.cc @@ -16,6 +16,9 @@ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #define FLOAT_SAMPLES 1 #include @@ -29,10 +32,6 @@ #undef PACKAGE_BUGREPORT #undef PACKAGE -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include #include #include @@ -47,7 +46,11 @@ GST_DEBUG_CATEGORY_STATIC (gst_bpm_detect_debug); struct _GstBPMDetectPrivate { gfloat bpm; +#if HAVE_SOUNDTOUCH_1_4 + soundtouch::BPMDetect *detect; +#else BPMDetect *detect; +#endif }; #define ALLOWED_CAPS \ @@ -197,8 +200,13 @@ gst_bpm_detect_transform_ip (GstBaseTransform * trans, GstBuffer * in) return GST_FLOW_ERROR; } +#if HAVE_SOUNDTOUCH_1_4 + bpm_detect->priv->detect = + new soundtouch::BPMDetect (filter->format.channels, filter->format.rate); +#else bpm_detect->priv->detect = new BPMDetect (filter->format.channels, filter->format.rate); +#endif } nsamples = GST_BUFFER_SIZE (in) / (4 * filter->format.channels);