diff options
author | Max Kellermann <max@duempel.org> | 2010-07-20 18:11:58 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2010-07-20 18:27:11 +0200 |
commit | 172182b18f00e062a4eae22dd4d0032750f37367 (patch) | |
tree | 0ac5d0899922a4f886645afdbbb159a57f91d7bb /src/decoder/mad_plugin.c | |
parent | 898a13f196eb005c969794bf16d8afa858a48f33 (diff) | |
download | mpd-172182b18f00e062a4eae22dd4d0032750f37367.tar.gz mpd-172182b18f00e062a4eae22dd4d0032750f37367.tar.xz mpd-172182b18f00e062a4eae22dd4d0032750f37367.zip |
decoder/mad: parse_rva2() returns bool
Diffstat (limited to '')
-rw-r--r-- | src/decoder/mad_plugin.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/decoder/mad_plugin.c b/src/decoder/mad_plugin.c index ee07ae5a4..88bc4c214 100644 --- a/src/decoder/mad_plugin.c +++ b/src/decoder/mad_plugin.c @@ -209,14 +209,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, @@ -230,18 +230,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 @@ -284,15 +284,14 @@ static int parse_rva2(struct id3_tag * tag, struct replay_gain_info * replay_gai "%+.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 |