From c39038f54927d619ec4fe0979788d9c4dcbb12aa Mon Sep 17 00:00:00 2001 From: learman Date: Sat, 25 Aug 2007 10:56:22 +0000 Subject: [PATCH] Remove some debug code. Remove some unnecessary checks. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14454 a1c6a512-1295-4272-9138-f99709370657 --- firmware/id3.c | 6 ++---- firmware/replaygain.c | 24 ++++++------------------ 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/firmware/id3.c b/firmware/id3.c index a0dda92eb..d4a906fd3 100644 --- a/firmware/id3.c +++ b/firmware/id3.c @@ -467,10 +467,8 @@ static int parserva2( struct mp3entry* entry, char* tag, int bufferpos ) gain = 0; } - if (gain) { - value_len = parse_replaygain_int(album, gain, peak * 2, entry, - tag, sizeof(entry->id3v2buf) - (tag - entry->id3v2buf)); - } + value_len = parse_replaygain_int(album, gain, peak * 2, entry, + tag, sizeof(entry->id3v2buf) - (tag - entry->id3v2buf)); } return tag - entry->id3v2buf + value_len; diff --git a/firmware/replaygain.c b/firmware/replaygain.c index 07726f19d..05395d1ef 100644 --- a/firmware/replaygain.c +++ b/firmware/replaygain.c @@ -429,34 +429,22 @@ long parse_replaygain_int(bool album, long gain, long peak, gain = convert_gain(gain * FP_ONE / 512); } - DEBUGF(" Album: %d\n", album); - DEBUGF(" Gain: %ld.%06ld\n", gain >> 24, - (long) (((long long) (abs(gain) & 0x00ffffff) * 1000000) / 0x01000000)); - DEBUGF(" Peak: %ld.%06ld\n", peak >> 24, - (long) (((long long) (abs(peak) & 0x00ffffff) * 1000000) / 0x01000000)); - if (album) { - if (!entry->album_gain) - { - entry->album_gain = gain; - entry->album_gain_string = buffer; - } + entry->album_gain = gain; + entry->album_gain_string = buffer; - if (!entry->album_peak) + if (peak) { entry->album_peak = peak; } } else { - if (!entry->track_gain) - { - entry->track_gain = gain; - entry->track_gain_string = buffer; - } + entry->track_gain = gain; + entry->track_gain_string = buffer; - if (!entry->track_peak) + if (peak) { entry->track_peak = peak; } -- 2.11.4.GIT