From e4752b52b81db51caf10c41fb5b26c293c23b8fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 13 Dec 2009 13:19:43 +0000 Subject: [PATCH] tag: id3v2: prefer two letter ISO 639-1 code for extended comment --- gst-libs/gst/tag/id3v2frames.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/tag/id3v2frames.c b/gst-libs/gst/tag/id3v2frames.c index a91279c412..79fdf61b32 100644 --- a/gst-libs/gst/tag/id3v2frames.c +++ b/gst-libs/gst/tag/id3v2frames.c @@ -276,7 +276,12 @@ parse_comment_frame (ID3TagsWorking * work) g_ascii_isalpha (language[0]) && g_ascii_isalpha (language[1]) && (g_ascii_isalpha (language[2]) || language[2] == '\0')) { - s = g_strdup_printf ("%s[%s]=%s", description, language, text); + const gchar *lang_code; + + /* prefer two-letter ISO 639-1 code if we have a mapping */ + lang_code = gst_tag_get_language_code (language); + s = g_strdup_printf ("%s[%s]=%s", description, + (lang_code) ? lang_code : language, text); } else { s = g_strdup_printf ("%s=%s", description, text); }