aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-08-05 23:19:22 +0200
committerMax Kellermann <max@duempel.org>2015-08-05 23:24:30 +0200
commitc8b602038e90b46aecaf2157069ba9073edec558 (patch)
tree040a82caf6b007de9dbe5040f8951c6a190eb754
parente384fa226eec299b1db5667c8cc940b3689c879c (diff)
downloadmpd-c8b602038e90b46aecaf2157069ba9073edec558.tar.gz
mpd-c8b602038e90b46aecaf2157069ba9073edec558.tar.xz
mpd-c8b602038e90b46aecaf2157069ba9073edec558.zip
decoder/mpcdec: use Clamp()
-rw-r--r--src/decoder/plugins/MpcdecDecoderPlugin.cxx8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/decoder/plugins/MpcdecDecoderPlugin.cxx b/src/decoder/plugins/MpcdecDecoderPlugin.cxx
index 4d1ad3bbf..c29364681 100644
--- a/src/decoder/plugins/MpcdecDecoderPlugin.cxx
+++ b/src/decoder/plugins/MpcdecDecoderPlugin.cxx
@@ -26,6 +26,7 @@
#include "util/Error.hxx"
#include "util/Domain.hxx"
#include "util/Macros.hxx"
+#include "util/Clamp.hxx"
#include "Log.hxx"
#include <mpc/mpcdec.h>
@@ -117,12 +118,7 @@ mpc_to_mpd_sample(MPC_SAMPLE_FORMAT sample)
val = sample * float_scale;
#endif
- if (val < clip_min)
- val = clip_min;
- else if (val > clip_max)
- val = clip_max;
-
- return val;
+ return Clamp(val, clip_min, clip_max);
}
static void