mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 15:51:11 +00:00
rtspsrc: Don't remove udpsrc/sink from rtspsrc if they were not added to it
This can happen in various error cases that could happen between the creation of the element in question and the adding to the rtspsrc. It causes an ugly critical warning right now but is otherwise harmless.
This commit is contained in:
parent
2513edf229
commit
a676c17259
1 changed files with 6 additions and 2 deletions
|
@ -2281,6 +2281,8 @@ gst_rtspsrc_stream_free (GstRTSPSrc * src, GstRTSPStream * stream)
|
|||
for (i = 0; i < 2; i++) {
|
||||
if (stream->udpsrc[i]) {
|
||||
gst_element_set_state (stream->udpsrc[i], GST_STATE_NULL);
|
||||
if (gst_object_has_as_parent (GST_OBJECT (stream->udpsrc[i]),
|
||||
GST_OBJECT (src)))
|
||||
gst_bin_remove (GST_BIN_CAST (src), stream->udpsrc[i]);
|
||||
gst_object_unref (stream->udpsrc[i]);
|
||||
}
|
||||
|
@ -2289,6 +2291,8 @@ gst_rtspsrc_stream_free (GstRTSPSrc * src, GstRTSPStream * stream)
|
|||
|
||||
if (stream->udpsink[i]) {
|
||||
gst_element_set_state (stream->udpsink[i], GST_STATE_NULL);
|
||||
if (gst_object_has_as_parent (GST_OBJECT (stream->udpsink[i]),
|
||||
GST_OBJECT (src)))
|
||||
gst_bin_remove (GST_BIN_CAST (src), stream->udpsink[i]);
|
||||
gst_object_unref (stream->udpsink[i]);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue