From f384231ca30c939ab8a83c8aa291c011672eff7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20P=C3=B6lsterl?= Date: Sun, 14 Jun 2009 23:12:13 +0200 Subject: [PATCH] Unref pipeline and set it to NULL. Set stream's caps to NULL, otherwise we unref it too often. --- gst/rtsp-server/rtsp-media.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gst/rtsp-server/rtsp-media.c b/gst/rtsp-server/rtsp-media.c index 502e478db5..fe54253702 100644 --- a/gst/rtsp-server/rtsp-media.c +++ b/gst/rtsp-server/rtsp-media.c @@ -142,13 +142,13 @@ gst_rtsp_media_finalize (GObject * obj) media = GST_RTSP_MEDIA (obj); g_message ("finalize media %p", media); -/* + if (media->pipeline) { unlock_streams (media); gst_element_set_state (media->pipeline, GST_STATE_NULL); gst_object_unref (media->pipeline); } -*/ + for (i = 0; i < media->streams->len; i++) { GstRTSPMediaStream *stream; @@ -1576,11 +1576,15 @@ gst_rtsp_media_remove_elements (GstRTSPMedia *media) gst_bin_remove (GST_BIN (media->pipeline), stream->tee[j]); gst_bin_remove (GST_BIN (media->pipeline), stream->selector[j]); } + stream->caps = NULL; gst_rtsp_media_stream_free (stream); } g_array_remove_range (media->streams, 0, media->streams->len); gst_element_set_state (media->rtpbin, GST_STATE_NULL); gst_bin_remove (GST_BIN (media->pipeline), media->rtpbin); + + gst_object_unref (media->pipeline); + media->pipeline = NULL; }