diff options
author | Jonathan Dieter <jdieter@lesbg.com> | 2012-04-23 21:59:20 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2012-04-23 23:29:56 +0200 |
commit | 57d89131e93eb7d062523dff63247e605ae4894b (patch) | |
tree | b8ed51d2b1f4fb00e2dc976097ce9e11dfb6e3a1 | |
parent | 7c6d1896a46ef139a76751cf0edc6576dd7c44e5 (diff) | |
download | mpd-57d89131e93eb7d062523dff63247e605ae4894b.tar.gz mpd-57d89131e93eb7d062523dff63247e605ae4894b.tar.xz mpd-57d89131e93eb7d062523dff63247e605ae4894b.zip |
tag_rva2: parse multiple ID3 "RVA2" tags
Diffstat (limited to '')
-rw-r--r-- | src/tag_rva2.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/tag_rva2.c b/src/tag_rva2.c index 776146fc5..9250311b9 100644 --- a/src/tag_rva2.c +++ b/src/tag_rva2.c @@ -135,6 +135,16 @@ rva2_apply_frame(struct replay_gain_info *replay_gain_info, bool tag_rva2_parse(struct id3_tag *tag, struct replay_gain_info *replay_gain_info) { - struct id3_frame const *frame = id3_tag_findframe(tag, "RVA2", 0); - return frame != NULL && rva2_apply_frame(replay_gain_info, frame); + bool found = false; + + /* Loop through all RVA2 frames as some programs (e.g. mp3gain) store + track and album gain in separate tags */ + const struct id3_frame *frame; + for (unsigned i = 0; + (frame = id3_tag_findframe(tag, "RVA2", i)) != NULL; + ++i) + if (rva2_apply_frame(replay_gain_info, frame)) + found = true; + + return found; } |