aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-01-21 20:29:20 +0100
committerMax Kellermann <max@duempel.org>2015-01-22 11:37:09 +0100
commit80a7e1ea7dae1968b1f7dee739adec91692beba8 (patch)
tree14f15218a8f6f6b477e7628a7ccc58f877d9b5d5 /src
parent0d3b26b3aaee6646ce5e825feca43299365797ec (diff)
downloadmpd-80a7e1ea7dae1968b1f7dee739adec91692beba8.tar.gz
mpd-80a7e1ea7dae1968b1f7dee739adec91692beba8.tar.xz
mpd-80a7e1ea7dae1968b1f7dee739adec91692beba8.zip
pcm/SoxrResampler: add a global soxr_runtime_spec_t variable
Diffstat (limited to 'src')
-rw-r--r--src/pcm/SoxrResampler.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pcm/SoxrResampler.cxx b/src/pcm/SoxrResampler.cxx
index 3c271261b..df462ed9d 100644
--- a/src/pcm/SoxrResampler.cxx
+++ b/src/pcm/SoxrResampler.cxx
@@ -41,6 +41,7 @@ static constexpr unsigned long SOXR_DEFAULT_RECIPE = SOXR_HQ;
static constexpr unsigned long SOXR_INVALID_RECIPE = -1;
static soxr_quality_spec_t soxr_quality;
+static soxr_runtime_spec_t soxr_runtime;
static const char *
soxr_quality_name(unsigned long recipe)
@@ -102,6 +103,9 @@ pcm_resample_soxr_global_init(const ConfigBlock &block, Error &error)
"soxr converter '%s'",
soxr_quality_name(recipe));
+ const unsigned n_threads = 1;
+ soxr_runtime = soxr_runtime_spec(n_threads);
+
return true;
}
@@ -115,7 +119,7 @@ SoxrPcmResampler::Open(AudioFormat &af, unsigned new_sample_rate,
soxr_error_t e;
soxr = soxr_create(af.sample_rate, new_sample_rate,
af.channels, &e,
- nullptr, &soxr_quality, nullptr);
+ nullptr, &soxr_quality, &soxr_runtime);
if (soxr == nullptr) {
error.Format(soxr_domain,
"soxr initialization has failed: %s", e);