From 5612863563b14b56221a23643d984b429c6f3a07 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Sat, 9 Nov 2013 16:59:00 +0100 Subject: fixed replaygain for 32bit streams --- replaygain.c | 6 ------ streamer.c | 3 +++ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/replaygain.c b/replaygain.c index 764b98df..5f3be0e4 100644 --- a/replaygain.c +++ b/replaygain.c @@ -211,12 +211,6 @@ apply_replay_gain_int32 (playItem_t *it, char *bytes, int size) { int32_t *s = (int32_t*)bytes; for (int j = 0; j < size/4; j++) { int64_t sample = ((int32_t)(*s)) * vol / 1000; - if (sample > 0x7fffffff) { - sample = 0x7fffffff; - } - else if (sample < -0x80000000) { - sample = -0x80000000; - } *s = (int32_t)sample; s++; } diff --git a/streamer.c b/streamer.c index 5c726258..d09ef738 100644 --- a/streamer.c +++ b/streamer.c @@ -2148,6 +2148,9 @@ streamer_read_async (char *bytes, int size) { is_eof = 1; } inputsize = nb; +// trace ("convert %d|%d|%d|%d|%d|%d to %d|%d|%d|%d|%d|%d\n" +// , fileinfo->fmt.bps, fileinfo->fmt.channels, fileinfo->fmt.samplerate, fileinfo->fmt.channelmask, fileinfo->fmt.is_float, fileinfo->fmt.is_bigendian +// , output->fmt.bps, output->fmt.channels, output->fmt.samplerate, output->fmt.channelmask, output->fmt.is_float, output->fmt.is_bigendian); bytesread = pcm_convert (&fileinfo->fmt, input, &output->fmt, bytes, inputsize); #ifdef ANDROID -- cgit v1.2.3