client: set session media to NULL without the lock

We need to set session medias to NULL without the client lock otherwise
we can end up in a deadlock if another thread is waiting for the lock
and media unprepare is also waiting for that thread to end.

https://bugzilla.gnome.org/show_bug.cgi?id=737690
This commit is contained in:
Aleix Conchillo Flaqué 2014-09-30 16:36:51 -07:00 committed by Luis de Bethencourt
parent 1badcd83c3
commit 6c0c90c9d2

View file

@ -346,9 +346,6 @@ client_unwatch_session (GstRTSPClient * client, GstRTSPSession * session,
priv->session_removed_id = 0;
}
/* unlink all media managed in this session */
gst_rtsp_session_filter (session, filter_session_media, client);
/* remove the session */
g_object_unref (session);
}
@ -357,6 +354,10 @@ static GstRTSPFilterResult
cleanup_session (GstRTSPClient * client, GstRTSPSession * sess,
gpointer user_data)
{
/* unlink all media managed in this session. This needs to happen
* without the client lock, so we really want to do it here. */
gst_rtsp_session_filter (sess, filter_session_media, client);
return GST_RTSP_FILTER_REMOVE;
}