decoder/mpcdec: use Clamp()

This commit is contained in:
Max Kellermann 2015-08-05 23:19:22 +02:00
parent e384fa226e
commit c8b602038e
1 changed files with 2 additions and 6 deletions

View File

@ -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