mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
rtsp-session: Fix segfault when doing keep-alive after removing the session
If keep-alive happens after removing the session but before finalizing the stream transport, we would segfault. https://bugzilla.gnome.org/show_bug.cgi?id=750544
This commit is contained in:
parent
ca855abae1
commit
6136ef66d4
1 changed files with 23 additions and 0 deletions
|
@ -250,6 +250,26 @@ gst_rtsp_session_manage_media (GstRTSPSession * sess, const gchar * path,
|
|||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_rtsp_session_unset_transport_keepalive (GstRTSPSessionMedia * sessmedia)
|
||||
{
|
||||
GstRTSPMedia *media;
|
||||
guint i, n_streams;
|
||||
|
||||
media = gst_rtsp_session_media_get_media (sessmedia);
|
||||
n_streams = gst_rtsp_media_n_streams (media);
|
||||
|
||||
for (i = 0; i < n_streams; i++) {
|
||||
GstRTSPStreamTransport *transport =
|
||||
gst_rtsp_session_media_get_transport (sessmedia, i);
|
||||
|
||||
if (!transport)
|
||||
continue;
|
||||
|
||||
gst_rtsp_stream_transport_set_keepalive (transport, NULL, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_rtsp_session_release_media:
|
||||
* @sess: a #GstRTSPSession
|
||||
|
@ -281,6 +301,9 @@ gst_rtsp_session_release_media (GstRTSPSession * sess,
|
|||
more = (priv->medias != NULL);
|
||||
g_mutex_unlock (&priv->lock);
|
||||
|
||||
if (find && !more)
|
||||
gst_rtsp_session_unset_transport_keepalive (media);
|
||||
|
||||
if (find)
|
||||
g_object_unref (media);
|
||||
|
||||
|
|
Loading…
Reference in a new issue