Fix some leaks and change default port

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.
This commit is contained in:
Wim Taymans 2009-01-30 11:06:31 +01:00
parent 704720f306
commit edd2175695
2 changed files with 12 additions and 1 deletions

View 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;

View file

@ -23,7 +23,7 @@
#include "rtsp-client.h"
#define DEFAULT_BACKLOG 5
#define DEFAULT_PORT 1554
#define DEFAULT_PORT 8554
enum
{