diff options
author | Sebastian Dröge <slomo@circular-chaos.org> | 2008-06-13 19:14:41 +0000 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2008-06-13 19:14:41 +0000 |
commit | 70ceffb790292508d8b94bb3a675c96135eeeb44 (patch) | |
tree | cd1fc0f46f8c5a6a7073cb095694ff4f6e95db28 /gst/matroska/matroska-demux.c | |
parent | 04d1c49ef7c6fe497c4b1d9d67590952e0d1266a (diff) |
gst/matroska/: Use gst_value_serialize() and gst_value_deserialize() for transforming tags from some GType to a strin...
Original commit message from CVS:
* gst/matroska/matroska-demux.c:
(gst_matroska_demux_parse_metadata_id_simple_tag):
* gst/matroska/matroska-mux.c: (gst_matroska_mux_write_simple_tag),
(gst_matroska_mux_write_data):
Use gst_value_serialize() and gst_value_deserialize() for transforming
tags from some GType to a string and the other way around. The default
transformations in GLib don't include transformations from string to
number types.
Diffstat (limited to 'gst/matroska/matroska-demux.c')
-rw-r--r-- | gst/matroska/matroska-demux.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c index 66a4938c..d8765ad3 100644 --- a/gst/matroska/matroska-demux.c +++ b/gst/matroska/matroska-demux.c @@ -2255,21 +2255,18 @@ gst_matroska_demux_parse_metadata_id_simple_tag (GstMatroskaDemux * demux, const gchar *tagname_mkv = tag_conv[i].matroska_tagname; if (strcmp (tagname_mkv, tag) == 0) { - GValue src = { 0, }; GValue dest = { 0, }; GType dest_type = gst_tag_get_type (tagname_gst); - g_value_init (&src, G_TYPE_STRING); - g_value_set_string (&src, value); g_value_init (&dest, dest_type); - if (g_value_transform (&src, &dest)) { + if (gst_value_deserialize (&dest, value)) { gst_tag_list_add_values (*p_taglist, GST_TAG_MERGE_APPEND, tagname_gst, &dest, NULL); } else { - GST_WARNING_OBJECT (demux, "Can't transform tag '%s' with" - "value '%s' to target type", tag, value); + GST_WARNING_OBJECT (demux, "Can't transform tag '%s' with " + "value '%s' to target type '%s'", tag, value, + g_type_name (dest_type)); } - g_value_unset (&src); g_value_unset (&dest); break; } |