Fix some leaks and change default port
authorWim Taymans <wim.taymans@collabora.co.uk>
Fri, 30 Jan 2009 10:06:31 +0000 (11:06 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Fri, 30 Jan 2009 11:18:01 +0000 (12:18 +0100)
Fix some memory leaks by setting the udpsrc elements to the unlocked state after
we finished the initial preroll. If we keep them locked, setting the pipeline to
NULL will not stop and clean up the sources correctly.

Change the default RTSP port to 8554 aka the official alternative RTSP port.

gst/rtsp-server/rtsp-media.c
gst/rtsp-server/rtsp-server.c

index 430978d..023a153 100644 (file)
@@ -395,6 +395,7 @@ setup_stream (GstRTSPMediaStream *stream, GstRTSPMedia *media)
 
   gst_bin_add (GST_BIN_CAST (media->pipeline), stream->udpsink[0]);
   gst_bin_add (GST_BIN_CAST (media->pipeline), stream->udpsink[1]);
+  gst_bin_add (GST_BIN_CAST (media->pipeline), stream->udpsrc[0]);
   gst_bin_add (GST_BIN_CAST (media->pipeline), stream->udpsrc[1]);
 
   /* hook up the stream to the RTP session elements. */
@@ -503,6 +504,16 @@ gst_rtsp_media_prepare (GstRTSPMedia *media)
   /* and back to PAUSED for live pipelines */
   ret = gst_element_set_state (media->pipeline, GST_STATE_PAUSED);
 
+  n_streams = gst_rtsp_media_n_streams (media);
+  for (i = 0; i < n_streams; i++) {
+    GstRTSPMediaStream *stream;
+
+    stream = gst_rtsp_media_get_stream (media, i);
+
+    gst_element_set_locked_state (stream->udpsrc[0], FALSE);
+    gst_element_set_locked_state (stream->udpsrc[1], FALSE);
+  }
+
   g_message ("object %p is prerolled", media);
   media->prepared = TRUE;
 
index afbfe92..873ca37 100644 (file)
@@ -23,7 +23,7 @@
 #include "rtsp-client.h"
 
 #define DEFAULT_BACKLOG         5
-#define DEFAULT_PORT            1554
+#define DEFAULT_PORT            8554
 
 enum
 {