aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/mad_decoder_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2010-07-20 23:03:06 +0200
committerMax Kellermann <max@duempel.org>2010-07-20 23:03:06 +0200
commitc0da938d4f9e6b15cc5cca80090a15aa89ff3d2b (patch)
treead9b4d900e4aa34b2c587423911c19f7d84cdde8 /src/decoder/mad_decoder_plugin.c
parentfb19aa355e566898fcb18bf3a5700a8e5f236696 (diff)
parent0fec8e08641470fdcaeb68fc362f77ca78925011 (diff)
downloadmpd-c0da938d4f9e6b15cc5cca80090a15aa89ff3d2b.tar.gz
mpd-c0da938d4f9e6b15cc5cca80090a15aa89ff3d2b.tar.xz
mpd-c0da938d4f9e6b15cc5cca80090a15aa89ff3d2b.zip
Merge release 0.15.12 from branch 'v0.15.x'
Conflicts: NEWS configure.ac
Diffstat (limited to 'src/decoder/mad_decoder_plugin.c')
-rw-r--r--src/decoder/mad_decoder_plugin.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/decoder/mad_decoder_plugin.c b/src/decoder/mad_decoder_plugin.c
index 32e35f113..037fdfb15 100644
--- a/src/decoder/mad_decoder_plugin.c
+++ b/src/decoder/mad_decoder_plugin.c
@@ -212,14 +212,14 @@ mp3_fill_buffer(struct mp3_data *data)
#ifdef HAVE_ID3TAG
/* Parse mp3 RVA2 frame. Shamelessly stolen from madplay. */
-static int parse_rva2(struct id3_tag * tag, struct replay_gain_info * replay_gain_info)
+static bool
+parse_rva2(struct id3_tag *tag, struct replay_gain_info *replay_gain_info)
{
struct id3_frame const * frame;
id3_latin1_t const *id;
id3_byte_t const *data;
id3_length_t length;
- int found;
enum {
CHANNEL_OTHER = 0x00,
@@ -233,18 +233,18 @@ static int parse_rva2(struct id3_tag * tag, struct replay_gain_info * replay_gai
CHANNEL_SUBWOOFER = 0x08
};
- found = 0;
-
/* relative volume adjustment information */
frame = id3_tag_findframe(tag, "RVA2", 0);
- if (!frame) return 0;
+ if (frame == NULL)
+ return false;
id = id3_field_getlatin1(id3_frame_field(frame, 0));
data = id3_field_getbinarydata(id3_frame_field(frame, 1),
&length);
- if (!id || !data) return 0;
+ if (id == NULL || data == NULL)
+ return false;
/*
* "The 'identification' string is used to identify the
@@ -280,22 +280,21 @@ static int parse_rva2(struct id3_tag * tag, struct replay_gain_info * replay_gai
voladj_float = (double) voladj_fixed / 512;
- replay_gain_info->tuples[REPLAY_GAIN_TRACK].peak = voladj_float;
- replay_gain_info->tuples[REPLAY_GAIN_ALBUM].peak = voladj_float;
+ replay_gain_info->tuples[REPLAY_GAIN_TRACK].gain = voladj_float;
+ replay_gain_info->tuples[REPLAY_GAIN_ALBUM].gain = voladj_float;
g_debug("parseRVA2: Relative Volume "
"%+.1f dB adjustment (%s)\n",
voladj_float, id);
- found = 1;
- break;
+ return true;
}
data += 4 + peak_bytes;
length -= 4 + peak_bytes;
}
- return found;
+ return false;
}
#endif