decoder/mpcdec: use Clamp()
This commit is contained in:
parent
f066bb7716
commit
2a58f22649
@ -26,6 +26,7 @@
|
|||||||
#include "util/Error.hxx"
|
#include "util/Error.hxx"
|
||||||
#include "util/Domain.hxx"
|
#include "util/Domain.hxx"
|
||||||
#include "util/Macros.hxx"
|
#include "util/Macros.hxx"
|
||||||
|
#include "util/Clamp.hxx"
|
||||||
#include "Log.hxx"
|
#include "Log.hxx"
|
||||||
|
|
||||||
#include <mpc/mpcdec.h>
|
#include <mpc/mpcdec.h>
|
||||||
@ -117,12 +118,7 @@ mpc_to_mpd_sample(MPC_SAMPLE_FORMAT sample)
|
|||||||
val = sample * float_scale;
|
val = sample * float_scale;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (val < clip_min)
|
return Clamp(val, clip_min, clip_max);
|
||||||
val = clip_min;
|
|
||||||
else if (val > clip_max)
|
|
||||||
val = clip_max;
|
|
||||||
|
|
||||||
return val;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user