From 7c12435f9b8fc1471ead707d2fbf3051ae923b8c Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Sun, 2 Jun 2013 15:24:38 -0300 Subject: [PATCH] qtdemux: make sure taglist is writable before adding tags Avoids assertions --- gst/isomp4/qtdemux.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index a69e5f85f7..f9a92ebc83 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -9215,6 +9215,8 @@ qtdemux_parse_udta (GstQTDemux * qtdemux, GNode * udta) if (!qtdemux->tag_list) { qtdemux->tag_list = gst_tag_list_new_empty (); gst_tag_list_set_scope (qtdemux->tag_list, GST_TAG_SCOPE_GLOBAL); + } else { + qtdemux->tag_list = gst_tag_list_make_writable (qtdemux->tag_list); } i = 0; @@ -9473,6 +9475,14 @@ qtdemux_parse_tree (GstQTDemux * qtdemux) GstDateTime *datetime = NULL; gint version; + /* make sure we have a usable taglist */ + if (!qtdemux->tag_list) { + qtdemux->tag_list = gst_tag_list_new_empty (); + gst_tag_list_set_scope (qtdemux->tag_list, GST_TAG_SCOPE_GLOBAL); + } else { + qtdemux->tag_list = gst_tag_list_make_writable (qtdemux->tag_list); + } + mvhd = qtdemux_tree_get_child_by_type (qtdemux->moov_node, FOURCC_mvhd); if (mvhd == NULL) { GST_LOG_OBJECT (qtdemux, "No mvhd node found, looking for redirects."); @@ -9512,11 +9522,6 @@ qtdemux_parse_tree (GstQTDemux * qtdemux) } } if (datetime) { - if (!qtdemux->tag_list) { - qtdemux->tag_list = gst_tag_list_new_empty (); - gst_tag_list_set_scope (qtdemux->tag_list, GST_TAG_SCOPE_GLOBAL); - } - /* Use KEEP as explicit tags should have a higher priority than mvhd tag */ gst_tag_list_add (qtdemux->tag_list, GST_TAG_MERGE_KEEP, GST_TAG_DATE_TIME, datetime, NULL);