From 16ed72626ee659b4dd572797bb54ff0c504f9844 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Thu, 5 Nov 2009 23:19:40 +0100 Subject: [PATCH] src/temporal/resampler.h: add dummy functions in case samplerate is not built in --- src/temporal/resampler.c | 29 +++++++++++++++++++++++++---- src/temporal/resampler.h | 4 ---- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/temporal/resampler.c b/src/temporal/resampler.c index dfc333a7..35565189 100644 --- a/src/temporal/resampler.c +++ b/src/temporal/resampler.c @@ -20,14 +20,14 @@ #include "config.h" -#if HAVE_SAMPLERATE - -#include /* from libsamplerate */ - #include "aubio_priv.h" #include "fvec.h" #include "temporal/resampler.h" +#if HAVE_SAMPLERATE + +#include /* from libsamplerate */ + struct _aubio_resampler_t { SRC_DATA *proc; @@ -73,4 +73,25 @@ aubio_resampler_do (aubio_resampler_t * s, fvec_t * input, fvec_t * output) } } +#else +struct _aubio_resampler_t +{ +}; + +aubio_resampler_t * +new_aubio_resampler (smpl_t ratio UNUSED, uint_t type UNUSED) +{ + AUBIO_ERR ("aubio was not compiled with libsamplerate\n"); + return NULL; +} + +void +del_aubio_resampler (aubio_resampler_t * s) +{ +} + +void +aubio_resampler_do (aubio_resampler_t * s, fvec_t * input, fvec_t * output) +{ +} #endif /* HAVE_SAMPLERATE */ diff --git a/src/temporal/resampler.h b/src/temporal/resampler.h index 644d6183..617ada35 100644 --- a/src/temporal/resampler.h +++ b/src/temporal/resampler.h @@ -30,8 +30,6 @@ */ -#if HAVE_SAMPLERATE - #ifdef __cplusplus extern "C" { #endif @@ -64,6 +62,4 @@ void aubio_resampler_do (aubio_resampler_t * s, fvec_t * input, } #endif -#endif /* HAVE_SAMPLERATE */ - #endif /* _RESAMPLE_H */ -- 2.26.2