summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--ext/gnomevfs/Makefile.am7
-rw-r--r--ext/gnomevfs/gstgnomevfssrc.c34
3 files changed, 20 insertions, 29 deletions
diff --git a/ChangeLog b/ChangeLog
index b17dbcfe..0d76d0d4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-12-11 Tim-Philipp Müller <tim at centricular dot net>
+
+ * ext/gnomevfs/Makefile.am:
+ * ext/gnomevfs/gstgnomevfssrc.c: (gst_gnome_vfs_src_unicodify):
+ Use gst_tag_freeform_string_to_utf8() here, which also takes
+ into account any character sets specified by the user via
+ environment variables.
+
2007-12-10 Wim Taymans <wim.taymans@gmail.com>
* gst/audioconvert/Makefile.am:
diff --git a/ext/gnomevfs/Makefile.am b/ext/gnomevfs/Makefile.am
index cfad81d4..626c47d8 100644
--- a/ext/gnomevfs/Makefile.am
+++ b/ext/gnomevfs/Makefile.am
@@ -6,8 +6,11 @@ libgstgnomevfs_la_SOURCES = \
gstgnomevfssrc.c \
gstgnomevfsuri.c
-libgstgnomevfs_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) $(GNOME_VFS_CFLAGS)
-libgstgnomevfs_la_LIBADD = $(GST_BASE_LIBS) $(GNOME_VFS_LIBS)
+libgstgnomevfs_la_CFLAGS = \
+ $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) $(GNOME_VFS_CFLAGS)
+libgstgnomevfs_la_LIBADD = \
+ $(top_builddir)/gst-libs/gst/tag/libgsttag-$(GST_MAJORMINOR).la \
+ $(GST_BASE_LIBS) $(GNOME_VFS_LIBS)
libgstgnomevfs_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
noinst_HEADERS = \
diff --git a/ext/gnomevfs/gstgnomevfssrc.c b/ext/gnomevfs/gstgnomevfssrc.c
index 4d8bf192..ac2b0cf7 100644
--- a/ext/gnomevfs/gstgnomevfssrc.c
+++ b/ext/gnomevfs/gstgnomevfssrc.c
@@ -101,6 +101,8 @@
#include <string.h>
#include <gst/gst.h>
+#include <gst/tag/tag.h>
+
/* gnome-vfs.h doesn't include the following header, which we need: */
#include <libgnomevfs/gnome-vfs-standard-callbacks.h>
@@ -482,35 +484,13 @@ gst_gnome_vfs_src_get_property (GObject * object, guint prop_id, GValue * value,
}
static char *
-unicodify (const char *str, int len, ...)
-{
- char *ret = NULL, *cset;
- va_list args;
- gsize bytes_read, bytes_written;
-
- if (g_utf8_validate (str, len, NULL))
- return g_strndup (str, len >= 0 ? len : strlen (str));
-
- va_start (args, len);
- while ((cset = va_arg (args, char *)) != NULL)
- {
- if (!strcmp (cset, "locale"))
- ret = g_locale_to_utf8 (str, len, &bytes_read, &bytes_written, NULL);
- else
- ret = g_convert (str, len, "UTF-8", cset,
- &bytes_read, &bytes_written, NULL);
- if (ret)
- break;
- }
- va_end (args);
-
- return ret;
-}
-
-static char *
gst_gnome_vfs_src_unicodify (const char *str)
{
- return unicodify (str, -1, "locale", "ISO-8859-1", NULL);
+ const gchar *env_vars[] = { "GST_ICY_TAG_ENCODING",
+ "GST_TAG_ENCODING", NULL
+ };
+
+ return gst_tag_freeform_string_to_utf8 (str, -1, env_vars);
}
static void