From af20a1c994fc829d1fe93da144fac8451e2295f6 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 12 Jan 2020 07:57:52 +0100 Subject: [PATCH] pulse: obey Pulse's maximum sample rate (fixes DSD128 playback) Closes https://github.com/MusicPlayerDaemon/MPD/issues/708 --- NEWS | 2 ++ src/output/plugins/PulseOutputPlugin.cxx | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 83388e38a..ba514ae9c 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.21.19 (not yet released) +* output + - pulse: obey Pulse's maximum sample rate (fixes DSD128 playback) * fix build failure with clang 10 ver 0.21.18 (2019/12/24) diff --git a/src/output/plugins/PulseOutputPlugin.cxx b/src/output/plugins/PulseOutputPlugin.cxx index fa1b06da9..ee7075625 100644 --- a/src/output/plugins/PulseOutputPlugin.cxx +++ b/src/output/plugins/PulseOutputPlugin.cxx @@ -650,7 +650,7 @@ PulseOutput::Open(AudioFormat &audio_format) break; } - ss.rate = audio_format.sample_rate; + ss.rate = std::min(audio_format.sample_rate, PA_RATE_MAX); ss.channels = audio_format.channels; /* create a stream .. */