diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | gst/qtdemux/Makefile.am | 5 | ||||
-rw-r--r-- | gst/qtdemux/qtdemux.c | 17 |
3 files changed, 22 insertions, 6 deletions
@@ -1,5 +1,11 @@ 2007-09-05 Tim-Philipp Müller <tim at centricular dot net> + * gst/qtdemux/Makefile.am: + * gst/qtdemux/qtdemux.c: + Don't assume tags are encoded as UTF-8 (#473670). + +2007-09-05 Tim-Philipp Müller <tim at centricular dot net> + * sys/v4l2/gstv4l2src.c: * sys/v4l2/gstv4l2src.h: * sys/v4l2/v4l2src_calls.c: diff --git a/gst/qtdemux/Makefile.am b/gst/qtdemux/Makefile.am index 2c4aa52a..8363cdac 100644 --- a/gst/qtdemux/Makefile.am +++ b/gst/qtdemux/Makefile.am @@ -2,8 +2,9 @@ plugin_LTLIBRARIES = libgstqtdemux.la libgstqtdemux_la_CFLAGS = ${GST_CFLAGS} $(GST_PLUGINS_BASE_CFLAGS) -libgstqtdemux_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) $(ZLIB_LIBS) \ - -lgstrtp-@GST_MAJORMINOR@ +libgstqtdemux_la_LIBADD = \ + $(GST_PLUGINS_BASE_LIBS) -lgstrtp-@GST_MAJORMINOR@ -lgsttag-@GST_MAJORMINOR@ \ + $(GST_BASE_LIBS) $(ZLIB_LIBS) libgstqtdemux_la_LDFLAGS = ${GST_PLUGIN_LDFLAGS} libgstqtdemux_la_SOURCES = quicktime.c gstrtpxqtdepay.c qtdemux.c qtdemux_types.c qtdemux_dump.c diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c index 531a1eff..6be21a90 100644 --- a/gst/qtdemux/qtdemux.c +++ b/gst/qtdemux/qtdemux.c @@ -51,6 +51,8 @@ #include "gst/gst-i18n-plugin.h" +#include <gst/tag/tag.h> + #include "qtdemux_types.h" #include "qtdemux_dump.h" #include "qtdemux_fourcc.h" @@ -3268,6 +3270,7 @@ unknown_stream: static void qtdemux_tag_add_str (GstQTDemux * qtdemux, const char *tag, GNode * node) { + const gchar *env_vars[] = { "GST_QT_TAG_ENCODING", "GST_TAG_ENCODING", NULL }; GNode *data; char *s; int len; @@ -3278,10 +3281,16 @@ qtdemux_tag_add_str (GstQTDemux * qtdemux, const char *tag, GNode * node) len = QT_UINT32 (data->data); type = QT_UINT32 ((guint8 *) data->data + 8); if (type == 0x00000001) { - s = g_strndup ((char *) data->data + 16, len - 16); - GST_DEBUG_OBJECT (qtdemux, "adding tag %s", s); - gst_tag_list_add (qtdemux->tag_list, GST_TAG_MERGE_REPLACE, tag, s, NULL); - g_free (s); + s = gst_tag_freeform_string_to_utf8 ((char *) data->data + 16, len - 16, + env_vars); + if (s) { + GST_DEBUG_OBJECT (qtdemux, "adding tag %s", GST_STR_NULL (s)); + gst_tag_list_add (qtdemux->tag_list, GST_TAG_MERGE_REPLACE, tag, s, + NULL); + g_free (s); + } else { + GST_DEBUG_OBJECT (qtdemux, "failed to convert %s tag to UTF-8", tag); + } } } } |