diff options
author | Max Kellermann <max@duempel.org> | 2015-08-05 23:19:22 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2015-10-16 18:11:42 +0200 |
commit | 2a58f2264936787ddd96b40c7626046592c2d1a0 (patch) | |
tree | a62911646b53b2d5d407475a2c836a0655a6ac3b /src/decoder | |
parent | f066bb7716200a83e209d27f6b4f87f012033266 (diff) | |
download | mpd-2a58f2264936787ddd96b40c7626046592c2d1a0.tar.gz mpd-2a58f2264936787ddd96b40c7626046592c2d1a0.tar.xz mpd-2a58f2264936787ddd96b40c7626046592c2d1a0.zip |
decoder/mpcdec: use Clamp()
Diffstat (limited to 'src/decoder')
-rw-r--r-- | src/decoder/plugins/MpcdecDecoderPlugin.cxx | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/decoder/plugins/MpcdecDecoderPlugin.cxx b/src/decoder/plugins/MpcdecDecoderPlugin.cxx index befed0f3b..91b5b55b9 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 |