aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-14 23:09:36 +0100
committerMax Kellermann <max@duempel.org>2009-01-14 23:09:36 +0100
commit25cf3333551c59ae518b1ecc4e68197ff1766670 (patch)
treea71dd7ccc7a7be62ce4bf859ee6092f05f665805 /src
parent5a26c949bbdc5791d6884131ab8b18295f5b6f9e (diff)
downloadmpd-25cf3333551c59ae518b1ecc4e68197ff1766670.tar.gz
mpd-25cf3333551c59ae518b1ecc4e68197ff1766670.tar.xz
mpd-25cf3333551c59ae518b1ecc4e68197ff1766670.zip
oggvorbis: use vorbis_comment_value() in vorbis_parse_comment()
Eliminate some duplicate code.
Diffstat (limited to '')
-rw-r--r--src/decoder/oggvorbis_plugin.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/decoder/oggvorbis_plugin.c b/src/decoder/oggvorbis_plugin.c
index 60ad0d07c..772526225 100644
--- a/src/decoder/oggvorbis_plugin.c
+++ b/src/decoder/oggvorbis_plugin.c
@@ -144,8 +144,7 @@ static const char *VORBIS_COMMENT_DISC_KEY = "discnumber";
static bool
vorbis_parse_comment(struct tag *tag, char *comment, enum tag_type tag_type)
{
- const char *needle;
- unsigned int len;
+ const char *needle, *value;
assert(tag != NULL);
@@ -159,10 +158,10 @@ vorbis_parse_comment(struct tag *tag, char *comment, enum tag_type tag_type)
default:
needle = mpdTagItemKeys[tag_type];
}
- len = strlen(needle);
- if (strncasecmp(comment, needle, len) == 0 && *(comment + len) == '=') {
- tag_add_item(tag, tag_type, comment + len + 1);
+ value = vorbis_comment_value(comment, needle);
+ if (value != NULL) {
+ tag_add_item(tag, tag_type, value);
return true;
}