[tracker] tracker-extract-mp3: Do not always use guessed encoding for ID3v2
- From: JÃrg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] tracker-extract-mp3: Do not always use guessed encoding for ID3v2
- Date: Sat, 20 Aug 2011 14:06:01 +0000 (UTC)
commit 9b2acf60b54fe9332a48f5260350c050e65c4111
Author: JÃrg Billeter <j bitron ch>
Date: Fri Aug 19 11:41:32 2011 +0200
tracker-extract-mp3: Do not always use guessed encoding for ID3v2
Always using guessed 8-bit encoding for ID3v2 breaks some valid MP3
files. This commit disables use of guessed encoding for ID3v2 except
for Cyrillic locales where broken ID3v2 tags appear to be common.
Fixes NB#278171.
src/tracker-extract/tracker-extract-mp3.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-mp3.c b/src/tracker-extract/tracker-extract-mp3.c
index f5b3a69..b6aa9c3 100644
--- a/src/tracker-extract/tracker-extract-mp3.c
+++ b/src/tracker-extract/tracker-extract-mp3.c
@@ -2136,6 +2136,21 @@ tracker_extract_get_metadata (const gchar *uri,
g_free (id3v1_buffer);
+ if (md.id3v1.encoding != NULL) {
+ gchar *locale;
+
+ locale = tracker_locale_get (TRACKER_LOCALE_LANGUAGE);
+ if (!g_str_has_prefix (locale, "ru") &&
+ !g_str_has_prefix (locale, "uk")) {
+ /* use guessed encoding for ID3v2 tags only in selected locales
+ where broken ID3v2 is widespread */
+ g_free (md.id3v1.encoding);
+ md.id3v1.encoding = NULL;
+ }
+ g_free (locale);
+ locale = NULL;
+ }
+
/* Get other embedded tags */
audio_offset = parse_id3v2 (buffer, buffer_size, &md.id3v1, uri, metadata, &md);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]