summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Krakora <rob.krakora at messagenetsystems.com>2011-08-16 12:09:48 +0200
committerWim Taymans <wim.taymans@collabora.co.uk>2011-08-16 12:09:48 +0200
commitf7223cfdab653409cd92d117c906de166b00623b (patch)
tree38a7f4c5d472e34bd27f4c59c9ca89546c16f019
parent5dc9e76125466be7990187b78000b1df32704312 (diff)
client: destroy pipeline on client disconnect with no prior TEARDOWN.
The problem occurs when the client abruptly closes the connection without issuing a TEARDOWN. The TEARDOWN handler in the rtsp-client.c file of the RTSP server is where the pipeline gets torn down. Since this handler is not called, the pipeline remains and is up and running. Subsequent clients get their own pipelines and if the do not issue TEARDOWNs then those pipelines will also remain up and running. This is a resource leak.
-rw-r--r--gst/rtsp-server/rtsp-client.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gst/rtsp-server/rtsp-client.c b/gst/rtsp-server/rtsp-client.c
index 6a5bc76..ec91752 100644
--- a/gst/rtsp-server/rtsp-client.c
+++ b/gst/rtsp-server/rtsp-client.c
@@ -121,8 +121,12 @@ client_unlink_session (GstRTSPClient * client, GstRTSPSession * session)
/* unlink all media managed in this session */
for (medias = session->medias; medias; medias = g_list_next (medias)) {
- unlink_session_streams (client, session,
- (GstRTSPSessionMedia *) medias->data);
+ GstRTSPSessionMedia *media = medias->data;
+
+ gst_rtsp_session_media_set_state (media, GST_STATE_NULL);
+ unlink_session_streams (client, session, media);
+ /* unmanage the media in the session. */
+ gst_rtsp_session_release_media (session, media);
}
}