summaryrefslogtreecommitdiff
path: root/src/pcm
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2020-02-02 21:21:57 -0800
committerRosen Penev <rosenp@gmail.com>2020-03-25 18:54:15 -0700
commit85c27840a303145e887d7d30f0141236c21aafef (patch)
treef84253a9f17d15639fcbbfab18dbcb34e006a6cf /src/pcm
parent81c16273c543822fa8b87522cb1146a7859edd7a (diff)
treewide: use boost::lround when std::round is unavailable
This is the case with uClibc-ng currently. Signed-off-by: Rosen Penev <rosenp@gmail.com> (cherry picked from commit 769cd0ee9f0cf8ceb026aa751b5d4a390bb5dbdc) (changed define to match master)
Diffstat (limited to 'src/pcm')
-rw-r--r--src/pcm/PcmMix.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/pcm/PcmMix.cxx b/src/pcm/PcmMix.cxx
index 13f558d5e..bbb26d1c4 100644
--- a/src/pcm/PcmMix.cxx
+++ b/src/pcm/PcmMix.cxx
@@ -22,11 +22,10 @@
#include "Clamp.hxx"
#include "Traits.hxx"
#include "util/Clamp.hxx"
+#include "util/Math.hxx"
#include "PcmDither.cxx" // including the .cxx file to get inlined templates
-#include <cmath>
-
#include <assert.h>
template<SampleFormat F, class Traits=SampleTraits<F>>
@@ -225,7 +224,7 @@ pcm_mix(PcmDither &dither, void *buffer1, const void *buffer2, size_t size,
s = sin(M_PI_2 * portion1);
s *= s;
- int vol1 = std::lround(s * PCM_VOLUME_1S);
+ int vol1 = lround(s * PCM_VOLUME_1S);
vol1 = Clamp<int>(vol1, 0, PCM_VOLUME_1S);
return pcm_add_vol(dither, buffer1, buffer2, size,