Commit 67de7ea1 authored by Eric Wong's avatar Eric Wong

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
parent 504d3425
......@@ -53,7 +53,7 @@ void init_FlacData(FlacData * data, OutputBuffer * cb,
}
static int flacFindVorbisCommentFloat(const FLAC__StreamMetadata * block,
char *cmnt, float *fl)
const char *cmnt, float *fl)
{
int offset =
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,
FlacData * data)
{
unsigned int found = 0;
int found = 0;
if (data->replayGainInfo)
freeReplayGainInfo(data->replayGainInfo);
data->replayGainInfo = newReplayGainInfo();
found &= flacFindVorbisCommentFloat(block, "replaygain_album_gain",
found |= flacFindVorbisCommentFloat(block, "replaygain_album_gain",
&data->replayGainInfo->albumGain);
found &= flacFindVorbisCommentFloat(block, "replaygain_album_peak",
found |= flacFindVorbisCommentFloat(block, "replaygain_album_peak",
&data->replayGainInfo->albumPeak);
found &= flacFindVorbisCommentFloat(block, "replaygain_track_gain",
found |= flacFindVorbisCommentFloat(block, "replaygain_track_gain",
&data->replayGainInfo->trackGain);
found &= flacFindVorbisCommentFloat(block, "replaygain_track_peak",
found |= flacFindVorbisCommentFloat(block, "replaygain_track_peak",
&data->replayGainInfo->trackPeak);
if (!found) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment