diff options
author | Max Kellermann <max@duempel.org> | 2014-11-11 11:43:52 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-11-11 11:43:52 +0100 |
commit | c3f6502be277ea7a9eb42babc4dc44ab2abf59e2 (patch) | |
tree | 1282ad28125722133058fb21846877454f139bc2 /src/pcm | |
parent | 0120f396acadc56ef907e64a2ec40060e4ee5678 (diff) | |
parent | e5217e6ce97d4a0f972223f5eb6308e9b5e8df8f (diff) | |
download | mpd-c3f6502be277ea7a9eb42babc4dc44ab2abf59e2.tar.gz mpd-c3f6502be277ea7a9eb42babc4dc44ab2abf59e2.tar.xz mpd-c3f6502be277ea7a9eb42babc4dc44ab2abf59e2.zip |
Merge tag 'v0.19.3'
Diffstat (limited to '')
-rw-r--r-- | src/pcm/SoxrResampler.cxx | 3 |
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); |