summaryrefslogtreecommitdiffstats
path: root/gst/qtdemux
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.net>2007-09-05 16:23:21 +0000
committerTim-Philipp Müller <tim@centricular.net>2007-09-05 16:23:21 +0000
commitc8af2199d324ee9b055777fda0800b9438ab7262 (patch)
tree9b9cd28788a5bff05cee223037cbb78faac28979 /gst/qtdemux
parent7c69e902364f02b40c054befed6857fddb8b945d (diff)
gst/qtdemux/: Don't assume tags are encoded as UTF-8 (#473670).
Original commit message from CVS: * gst/qtdemux/Makefile.am: * gst/qtdemux/qtdemux.c: Don't assume tags are encoded as UTF-8 (#473670).
Diffstat (limited to 'gst/qtdemux')
-rw-r--r--gst/qtdemux/Makefile.am5
-rw-r--r--gst/qtdemux/qtdemux.c17
2 files changed, 16 insertions, 6 deletions
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);
+ }
}
}
}