mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 08:41:07 +00:00
tee: Lock mutex before reading the removed flag of the pads
Otherwise we're not guaranteed to read the very latest value that another thread might've written in there when the pad was released, and could instead work with an old value.
This commit is contained in:
parent
487a3f9a30
commit
aa29864317
1 changed files with 2 additions and 0 deletions
|
@ -899,12 +899,14 @@ gst_tee_handle_data (GstTee * tee, gpointer data, gboolean is_list)
|
||||||
ret = gst_pad_push (pad, GST_BUFFER_CAST (data));
|
ret = gst_pad_push (pad, GST_BUFFER_CAST (data));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GST_OBJECT_LOCK (tee);
|
||||||
if (GST_TEE_PAD_CAST (pad)->removed)
|
if (GST_TEE_PAD_CAST (pad)->removed)
|
||||||
ret = GST_FLOW_NOT_LINKED;
|
ret = GST_FLOW_NOT_LINKED;
|
||||||
|
|
||||||
if (ret == GST_FLOW_NOT_LINKED && tee->allow_not_linked) {
|
if (ret == GST_FLOW_NOT_LINKED && tee->allow_not_linked) {
|
||||||
ret = GST_FLOW_OK;
|
ret = GST_FLOW_OK;
|
||||||
}
|
}
|
||||||
|
GST_OBJECT_UNLOCK (tee);
|
||||||
|
|
||||||
gst_object_unref (pad);
|
gst_object_unref (pad);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue