aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-08-04 00:15:46 +0200
committerMax Kellermann <max@duempel.org>2009-08-04 00:15:46 +0200
commit4363c49443f8371a4e9a28fff552355df6aa0f55 (patch)
tree1764aa70ec6523024c737cc80442d6443231823e /src
parent09571fcc553127822b3f3967c2593fe72ae6b21b (diff)
downloadmpd-4363c49443f8371a4e9a28fff552355df6aa0f55.tar.gz
mpd-4363c49443f8371a4e9a28fff552355df6aa0f55.tar.xz
mpd-4363c49443f8371a4e9a28fff552355df6aa0f55.zip
tag_id3: moved id3_genre_name() call to tag_id3_import_text()
The ID3_FRAME_GENRE field is queried only in tag_id3_import_text(). Don't pass the tag type to import_id3_string().
Diffstat (limited to 'src')
-rw-r--r--src/tag_id3.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/tag_id3.c b/src/tag_id3.c
index 66d37be9e..c78983615 100644
--- a/src/tag_id3.c
+++ b/src/tag_id3.c
@@ -79,14 +79,12 @@ tag_id3_getstring(const struct id3_frame *frame, unsigned i)
/* This will try to convert a string to utf-8,
*/
static id3_utf8_t *
-import_id3_string(bool is_id3v1, const id3_ucs4_t *ucs4, enum tag_type type)
+import_id3_string(bool is_id3v1, const id3_ucs4_t *ucs4)
{
id3_utf8_t *utf8, *utf8_stripped;
id3_latin1_t *isostr;
const char *encoding;
- if (type == TAG_ITEM_GENRE)
- ucs4 = id3_genre_name(ucs4);
/* use encoding field here? */
if (is_id3v1 &&
(encoding = config_get_string(CONF_ID3V1_ENCODING, NULL)) != NULL) {
@@ -159,8 +157,10 @@ tag_id3_import_text(struct tag *dest, struct id3_tag *tag, const char *id,
if (ucs4 == NULL)
continue;
- utf8 = import_id3_string(tag_is_id3v1(tag),
- ucs4, type);
+ if (type == TAG_ITEM_GENRE)
+ ucs4 = id3_genre_name(ucs4);
+
+ utf8 = import_id3_string(tag_is_id3v1(tag), ucs4);
if (utf8 == NULL)
continue;
@@ -200,7 +200,7 @@ tag_id3_import_comment(struct tag *dest, struct id3_tag *tag, const char *id,
if (ucs4 == NULL)
return;
- utf8 = import_id3_string(tag_is_id3v1(tag), ucs4, type);
+ utf8 = import_id3_string(tag_is_id3v1(tag), ucs4);
if (utf8 == NULL)
return;