rtsp-stream: fixed assert during update transport

When RTSP server trying update transport during multicast, it throws an
assert. The assert is thrown because it is trying to get the parent of
an non-existing funnel element.

https://bugzilla.gnome.org/show_bug.cgi?id=760150
This commit is contained in:
Srimanta Panda 2016-01-05 13:10:36 +01:00 committed by Sebastian Dröge
parent bec94861b0
commit fdbda049c6

View file

@ -2911,7 +2911,7 @@ update_transport (GstRTSPStream * stream, GstRTSPStreamTransport * trans,
GstRTSPMulticastTransportSource *source;
GstBin *bin;
bin = GST_BIN (gst_object_get_parent (GST_OBJECT (priv->funnel[0])));
bin = GST_BIN (gst_object_get_parent (GST_OBJECT (priv->funnel[1])));
if (add) {
gchar *host;
@ -2940,6 +2940,7 @@ update_transport (GstRTSPStream * stream, GstRTSPStreamTransport * trans,
gst_bin_add (bin, source->udpsrc[i]);
/* and link to the funnel v4 */
if (priv->sinkpad || i == 1) {
source->selpad[i] = selpad =
gst_element_get_request_pad (priv->funnel[i], "sink_%u");
pad = gst_element_get_static_pad (source->udpsrc[i], "src");
@ -2947,6 +2948,7 @@ update_transport (GstRTSPStream * stream, GstRTSPStreamTransport * trans,
gst_object_unref (pad);
gst_object_unref (selpad);
}
}
priv->transport_sources =
g_list_prepend (priv->transport_sources, source);
@ -2974,9 +2976,11 @@ update_transport (GstRTSPStream * stream, GstRTSPStreamTransport * trans,
gst_element_set_state (source->udpsrc[i], GST_STATE_NULL);
gst_object_unref (source->udpsrc[i]);
if (priv->sinkpad || i == 1) {
gst_element_release_request_pad (priv->funnel[i],
source->selpad[i]);
}
}
g_slice_free (GstRTSPMulticastTransportSource, source);
}