aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcm
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-11-11 11:43:52 +0100
committerMax Kellermann <max@duempel.org>2014-11-11 11:43:52 +0100
commitc3f6502be277ea7a9eb42babc4dc44ab2abf59e2 (patch)
tree1282ad28125722133058fb21846877454f139bc2 /src/pcm
parent0120f396acadc56ef907e64a2ec40060e4ee5678 (diff)
parente5217e6ce97d4a0f972223f5eb6308e9b5e8df8f (diff)
downloadmpd-c3f6502be277ea7a9eb42babc4dc44ab2abf59e2.tar.gz
mpd-c3f6502be277ea7a9eb42babc4dc44ab2abf59e2.tar.xz
mpd-c3f6502be277ea7a9eb42babc4dc44ab2abf59e2.zip
Merge tag 'v0.19.3'
Diffstat (limited to '')
-rw-r--r--src/pcm/SoxrResampler.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pcm/SoxrResampler.cxx b/src/pcm/SoxrResampler.cxx
index 56b9760d5..b9d6fc099 100644
--- a/src/pcm/SoxrResampler.cxx
+++ b/src/pcm/SoxrResampler.cxx
@@ -147,7 +147,8 @@ SoxrPcmResampler::Resample(ConstBuffer<void> src, Error &error)
const size_t n_frames = src.size / frame_size;
- const size_t o_frames = size_t(n_frames * ratio + 0.5);
+ /* always round up: worst case output buffer size */
+ const size_t o_frames = size_t(n_frames * ratio) + 1;
float *output_buffer = (float *)buffer.Get(o_frames * frame_size);