aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcm/ConfiguredResampler.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-11-10 19:17:16 +0100
committerMax Kellermann <max@duempel.org>2013-12-01 19:13:39 +0100
commit3e11a28cd9c204076407f02a600fcc617c7e0f3e (patch)
tree798cddd1c3804a558b1cdc885b70f5197e68d31e /src/pcm/ConfiguredResampler.cxx
parent3ed80f31399c80a90bc3d2a845e739fff485d7c5 (diff)
downloadmpd-3e11a28cd9c204076407f02a600fcc617c7e0f3e.tar.gz
mpd-3e11a28cd9c204076407f02a600fcc617c7e0f3e.tar.xz
mpd-3e11a28cd9c204076407f02a600fcc617c7e0f3e.zip
pcm/SoxrResampler: new resampler option using libsoxr
Diffstat (limited to 'src/pcm/ConfiguredResampler.cxx')
-rw-r--r--src/pcm/ConfiguredResampler.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/pcm/ConfiguredResampler.cxx b/src/pcm/ConfiguredResampler.cxx
index f562e4a2b..845fa2332 100644
--- a/src/pcm/ConfiguredResampler.cxx
+++ b/src/pcm/ConfiguredResampler.cxx
@@ -29,6 +29,10 @@
#include "LibsamplerateResampler.hxx"
#endif
+#ifdef HAVE_SOXR
+#include "SoxrResampler.hxx"
+#endif
+
#include <string.h>
enum class SelectedResampler {
@@ -37,6 +41,10 @@ enum class SelectedResampler {
#ifdef HAVE_LIBSAMPLERATE
LIBSAMPLERATE,
#endif
+
+#ifdef HAVE_SOXR
+ SOXR,
+#endif
};
static SelectedResampler selected_resampler = SelectedResampler::FALLBACK;
@@ -50,6 +58,13 @@ pcm_resampler_global_init(Error &error)
if (strcmp(converter, "internal") == 0)
return true;
+#ifdef HAVE_SOXR
+ if (strcmp(converter, "soxr") == 0) {
+ selected_resampler = SelectedResampler::SOXR;
+ return true;
+ }
+#endif
+
#ifdef HAVE_LIBSAMPLERATE
selected_resampler = SelectedResampler::LIBSAMPLERATE;
return pcm_resample_lsr_global_init(converter, error);
@@ -75,6 +90,11 @@ pcm_resampler_create()
case SelectedResampler::LIBSAMPLERATE:
return new LibsampleratePcmResampler();
#endif
+
+#ifdef HAVE_SOXR
+ case SelectedResampler::SOXR:
+ return new SoxrPcmResampler();
+#endif
}
gcc_unreachable();