Commit 6a9983cd authored by Tim-Philipp Müller's avatar Tim-Philipp Müller

avimux, flvmux, matroskamux: don't crash if tags arrive on multiple input pads at the same time

This is a temporary fix for the release only.

Fixes #619533.
parent 49463a37
......@@ -1166,7 +1166,10 @@ gst_avi_mux_riff_get_avi_header (GstAviMux * avimux)
else {
/* need to make snapshot of current state of tags to ensure the same set
* is used next time around during header rewrite at the end */
/* FIXME: remove locking again after GstTagSetter has been fixed */
GST_OBJECT_LOCK (avimux);
tags = gst_tag_setter_get_tag_list (GST_TAG_SETTER (avimux));
GST_OBJECT_UNLOCK (avimux);
if (tags)
tags = avimux->tags_snap = gst_tag_list_copy (tags);
}
......@@ -1919,10 +1922,15 @@ gst_avi_mux_handle_event (GstPad * pad, GstEvent * event)
case GST_EVENT_TAG:{
GstTagList *list;
GstTagSetter *setter = GST_TAG_SETTER (avimux);
const GstTagMergeMode mode = gst_tag_setter_get_tag_merge_mode (setter);
GstTagMergeMode mode;
gst_event_parse_tag (event, &list);
/* FIXME: remove locking again after GstTagSetter has been fixed */
GST_OBJECT_LOCK (avimux);
mode = gst_tag_setter_get_tag_merge_mode (setter);
gst_tag_setter_merge_tags (setter, list, mode);
GST_OBJECT_UNLOCK (avimux);
break;
}
default:
......
......@@ -256,10 +256,15 @@ gst_flv_mux_handle_sink_event (GstPad * pad, GstEvent * event)
case GST_EVENT_TAG:{
GstTagList *list;
GstTagSetter *setter = GST_TAG_SETTER (mux);
const GstTagMergeMode mode = gst_tag_setter_get_tag_merge_mode (setter);
GstTagMergeMode mode;
gst_event_parse_tag (event, &list);
/* FIXME: remove locking again after GstTagSetter has been fixed */
GST_OBJECT_LOCK (mux);
mode = gst_tag_setter_get_tag_merge_mode (setter);
gst_tag_setter_merge_tags (setter, list, mode);
GST_OBJECT_UNLOCK (mux);
break;
}
case GST_EVENT_NEWSEGMENT:
......@@ -634,7 +639,10 @@ gst_flv_mux_create_metadata (GstFlvMux * mux)
guint8 *data;
gint i, n_tags, tags_written = 0;
/* FIXME: remove locking again after GstTagSetter has been fixed */
GST_OBJECT_LOCK (mux);
tags = gst_tag_setter_get_tag_list (GST_TAG_SETTER (mux));
GST_OBJECT_UNLOCK (mux);
GST_DEBUG_OBJECT (mux, "tags = %" GST_PTR_FORMAT, tags);
......
......@@ -625,8 +625,11 @@ gst_matroska_mux_handle_sink_event (GstPad * pad, GstEvent * event)
g_free (lang);
}
/* FIXME: remove locking again after GstTagSetter has been fixed */
GST_OBJECT_LOCK (mux);
gst_tag_setter_merge_tags (GST_TAG_SETTER (mux), list,
gst_tag_setter_get_tag_merge_mode (GST_TAG_SETTER (mux)));
GST_OBJECT_UNLOCK (mux);
break;
}
case GST_EVENT_NEWSEGMENT:
......@@ -2205,7 +2208,10 @@ gst_matroska_mux_finish (GstMatroskaMux * mux)
}
/* tags */
/* FIXME: remove locking again after GstTagSetter has been fixed */
GST_OBJECT_LOCK (mux);
tags = gst_tag_setter_get_tag_list (GST_TAG_SETTER (mux));
GST_OBJECT_UNLOCK (mux);
if (tags != NULL && !gst_tag_list_is_empty (tags)) {
guint64 master_tags, master_tag;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment