diff options
author | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2010-03-13 12:06:24 +0100 |
---|---|---|
committer | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2010-03-16 20:29:34 +0100 |
commit | 34ff325e217b33be3ad80c87a377eb7dc0902f46 (patch) | |
tree | 8229f26bc668592fb82362fae5deb063362adaf6 | |
parent | b17fed7cf3d1ee7e0fef5de51e1d1cbacc21a06b (diff) | |
download | pianobar-34ff325e217b33be3ad80c87a377eb7dc0902f46.tar.gz pianobar-34ff325e217b33be3ad80c87a377eb7dc0902f46.tar.bz2 pianobar-34ff325e217b33be3ad80c87a377eb7dc0902f46.zip |
Use SHRT_MAX for short int
-rw-r--r-- | src/player.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/player.c b/src/player.c index 051220c..e895558 100644 --- a/src/player.c +++ b/src/player.c @@ -69,10 +69,10 @@ static inline signed short int applyReplayGain (signed short int value, unsigned int scale) { int tmpReplayBuf = value * scale; /* avoid clipping */ - if (tmpReplayBuf > INT16_MAX*RG_SCALE_FACTOR) { - return INT16_MAX; - } else if (tmpReplayBuf < INT16_MIN*RG_SCALE_FACTOR) { - return INT16_MIN; + if (tmpReplayBuf > SHRT_MAX*RG_SCALE_FACTOR) { + return SHRT_MAX; + } else if (tmpReplayBuf < SHRT_MIN*RG_SCALE_FACTOR) { + return SHRT_MIN; } else { return tmpReplayBuf / RG_SCALE_FACTOR; } |