fix Replay Gain reading for FLAC and OggFLAC

This bug was NOT introduced in my OggFLAC additions, honest!

As far as I can see, it was introduced way back in r2482, but
nobody ever noticed until the post here:
http://www.musicpd.org/forum/index.php?topic=1152.0

While we're at it, clean up some of the variable typing.

git-svn-id: https://svn.musicpd.org/mpd/trunk@4664 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
Eric Wong 2006-08-22 06:36:56 +00:00
parent 504d3425f2
commit 67de7ea116

View File

@ -53,7 +53,7 @@ void init_FlacData(FlacData * data, OutputBuffer * cb,
} }
static int flacFindVorbisCommentFloat(const FLAC__StreamMetadata * block, static int flacFindVorbisCommentFloat(const FLAC__StreamMetadata * block,
char *cmnt, float *fl) const char *cmnt, float *fl)
{ {
int offset = int offset =
FLAC__metadata_object_vorbiscomment_find_entry_from(block, 0, cmnt); FLAC__metadata_object_vorbiscomment_find_entry_from(block, 0, cmnt);
@ -82,20 +82,20 @@ static int flacFindVorbisCommentFloat(const FLAC__StreamMetadata * block,
static void flacParseReplayGain(const FLAC__StreamMetadata * block, static void flacParseReplayGain(const FLAC__StreamMetadata * block,
FlacData * data) FlacData * data)
{ {
unsigned int found = 0; int found = 0;
if (data->replayGainInfo) if (data->replayGainInfo)
freeReplayGainInfo(data->replayGainInfo); freeReplayGainInfo(data->replayGainInfo);
data->replayGainInfo = newReplayGainInfo(); data->replayGainInfo = newReplayGainInfo();
found &= flacFindVorbisCommentFloat(block, "replaygain_album_gain", found |= flacFindVorbisCommentFloat(block, "replaygain_album_gain",
&data->replayGainInfo->albumGain); &data->replayGainInfo->albumGain);
found &= flacFindVorbisCommentFloat(block, "replaygain_album_peak", found |= flacFindVorbisCommentFloat(block, "replaygain_album_peak",
&data->replayGainInfo->albumPeak); &data->replayGainInfo->albumPeak);
found &= flacFindVorbisCommentFloat(block, "replaygain_track_gain", found |= flacFindVorbisCommentFloat(block, "replaygain_track_gain",
&data->replayGainInfo->trackGain); &data->replayGainInfo->trackGain);
found &= flacFindVorbisCommentFloat(block, "replaygain_track_peak", found |= flacFindVorbisCommentFloat(block, "replaygain_track_peak",
&data->replayGainInfo->trackPeak); &data->replayGainInfo->trackPeak);
if (!found) { if (!found) {