summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@lavabit.com>2010-03-13 12:06:24 +0100
committerLars-Dominik Braun <PromyLOPh@lavabit.com>2010-03-16 20:29:34 +0100
commit34ff325e217b33be3ad80c87a377eb7dc0902f46 (patch)
tree8229f26bc668592fb82362fae5deb063362adaf6 /src
parentb17fed7cf3d1ee7e0fef5de51e1d1cbacc21a06b (diff)
downloadpianobar-34ff325e217b33be3ad80c87a377eb7dc0902f46.tar.gz
pianobar-34ff325e217b33be3ad80c87a377eb7dc0902f46.tar.bz2
pianobar-34ff325e217b33be3ad80c87a377eb7dc0902f46.zip
Use SHRT_MAX for short int
Diffstat (limited to 'src')
-rw-r--r--src/player.c8
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;
}