[gvfs] cdda: Fix CD-TEXT charset when building with libcdio >= 0.84
- From: Ross Lagerwall <rossl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] cdda: Fix CD-TEXT charset when building with libcdio >= 0.84
- Date: Tue, 23 Jun 2015 22:56:16 +0000 (UTC)
commit acbe277ed3636668faaf343ba6353fb28dbc9ec0
Author: Jonas Kümmerlin <rgcjonas gmail com>
Date: Tue Jun 23 17:42:02 2015 +0200
cdda: Fix CD-TEXT charset when building with libcdio >= 0.84
libcdio 0.84 already returns UTF-8 data. Trying to interpret it
as ISO-8859-1 won't lead to pretty results, so we better stop
doing that.
https://bugzilla.gnome.org/show_bug.cgi?id=751389
daemon/gvfsbackendcdda.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/daemon/gvfsbackendcdda.c b/daemon/gvfsbackendcdda.c
index b22ea9c..b3ffb70 100644
--- a/daemon/gvfsbackendcdda.c
+++ b/daemon/gvfsbackendcdda.c
@@ -158,6 +158,7 @@ release_metadata (GVfsBackendCdda *cdda_backend)
cdda_backend->tracks = NULL;
}
+#if LIBCDIO_VERSION_NUM < 84
static char *
cdtext_string_to_utf8 (const char *string)
{
@@ -167,6 +168,7 @@ cdtext_string_to_utf8 (const char *string)
/* CD-text doesn't specify encoding. In case outside ascii, assume latin-1. */
return g_convert (string, -1, "UTF-8", "ISO-8859-1", NULL, NULL, NULL);
}
+#endif
static void
fetch_metadata (GVfsBackendCdda *cdda_backend)
@@ -187,9 +189,9 @@ fetch_metadata (GVfsBackendCdda *cdda_backend)
if (cdtext) {
#if LIBCDIO_VERSION_NUM >= 84
- cdda_backend->album_title = cdtext_string_to_utf8 (cdtext_get_const (cdtext, CDTEXT_FIELD_TITLE, 0));
- cdda_backend->album_artist = cdtext_string_to_utf8 (cdtext_get_const (cdtext, CDTEXT_FIELD_PERFORMER,
0));
- cdda_backend->genre = cdtext_string_to_utf8 (cdtext_get_const (cdtext, CDTEXT_FIELD_GENRE, 0));
+ cdda_backend->album_title = g_strdup (cdtext_get_const (cdtext, CDTEXT_FIELD_TITLE, 0));
+ cdda_backend->album_artist = g_strdup (cdtext_get_const (cdtext, CDTEXT_FIELD_PERFORMER, 0));
+ cdda_backend->genre = g_strdup (cdtext_get_const (cdtext, CDTEXT_FIELD_GENRE, 0));
#else
cdda_backend->album_title = cdtext_string_to_utf8 (cdtext_get_const (CDTEXT_TITLE, cdtext));
cdda_backend->album_artist = cdtext_string_to_utf8 (cdtext_get_const (CDTEXT_PERFORMER, cdtext));
@@ -208,8 +210,8 @@ fetch_metadata (GVfsBackendCdda *cdda_backend)
#endif /* LIBCDIO_VERSION_NUM < 84 */
if (cdtext) {
#if LIBCDIO_VERSION_NUM >= 84
- track->title = cdtext_string_to_utf8 (cdtext_get_const (cdtext, CDTEXT_FIELD_TITLE, cdtrack));
- track->artist = cdtext_string_to_utf8 (cdtext_get_const (cdtext, CDTEXT_FIELD_PERFORMER, cdtrack));
+ track->title = g_strdup (cdtext_get_const (cdtext, CDTEXT_FIELD_TITLE, cdtrack));
+ track->artist = g_strdup (cdtext_get_const (cdtext, CDTEXT_FIELD_PERFORMER, cdtrack));
#else
track->title = cdtext_string_to_utf8 (cdtext_get_const (CDTEXT_TITLE, cdtext));
track->artist = cdtext_string_to_utf8 (cdtext_get_const (CDTEXT_PERFORMER, cdtext));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]