mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-22 05:56:31 +00:00
tee: Keep another ref to our one and only srcpad around while pushing
A pad probe on that pad might otherwise just release the pad, drop the last reference and cause great misery. https://bugzilla.gnome.org/show_bug.cgi?id=721300
This commit is contained in:
parent
0716b35219
commit
bdf3f4237d
1 changed files with 6 additions and 0 deletions
|
@ -591,6 +591,9 @@ gst_tee_handle_data (GstTee * tee, gpointer data, gboolean is_list)
|
||||||
if (!pads->next) {
|
if (!pads->next) {
|
||||||
GstPad *pad = GST_PAD_CAST (pads->data);
|
GstPad *pad = GST_PAD_CAST (pads->data);
|
||||||
|
|
||||||
|
/* Keep another ref around, a pad probe
|
||||||
|
* might release and destroy the pad */
|
||||||
|
gst_object_ref (pad);
|
||||||
GST_OBJECT_UNLOCK (tee);
|
GST_OBJECT_UNLOCK (tee);
|
||||||
|
|
||||||
if (pad == tee->pull_pad) {
|
if (pad == tee->pull_pad) {
|
||||||
|
@ -600,6 +603,9 @@ gst_tee_handle_data (GstTee * tee, gpointer data, gboolean is_list)
|
||||||
} else {
|
} else {
|
||||||
ret = gst_pad_push (pad, GST_BUFFER_CAST (data));
|
ret = gst_pad_push (pad, GST_BUFFER_CAST (data));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gst_object_unref (pad);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue