aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
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);