[vlc-devel] [PATCH] rtsp: change default to unpriviledged

Pierre Ynard linkfanel at yahoo.fr
Wed Dec 8 21:10:21 CET 2010


The default is currently 554 and it's never going to work out of the box
since it's priviledged. I'm not sure of what port to use: 5544? I had
one report of /etc/services listing rtsp-alt as 8554. However there's
one thing that bothers me: you're prompted to give an URL to sdp=, and
if you pass an actual RTSP URL then it won't be interpreted as per the
RFC (exporting the SDP through HTTP defaults to port 80 too).


diff --git a/modules/misc/rtsp.c b/modules/misc/rtsp.c
index 9f831de..8d7875d 100644
--- a/modules/misc/rtsp.c
+++ b/modules/misc/rtsp.c
@@ -62,7 +62,7 @@ static void Close( vlc_object_t * );
 #define HOST_LONGTEXT N_( \
     "This defines the address, port and path the RTSP VOD server will listen " \
     "on.\nSyntax is address:port/path. The default is to listen on all "\
-    "interfaces (address 0.0.0.0), on port 554, with no path.\nTo listen " \
+    "interfaces (address 0.0.0.0), on port 5544, with no path.\nTo listen " \
     "only on the local interface, use \"localhost\" as address." )
 
 #define THROTTLE_TEXT N_( "Maximum number of connections" )
@@ -265,7 +265,7 @@ static int Open( vlc_object_t *p_this )
     vlc_UrlParse( &url, psz_url, 0 );
     free( psz_url );
 
-    if( url.i_port <= 0 ) url.i_port = 554;
+    if( url.i_port <= 0 ) url.i_port = 5544;
 
     p_vod->p_sys = p_sys = malloc( sizeof( vod_sys_t ) );
     if( !p_sys ) goto error;
diff --git a/modules/stream_out/rtp.c b/modules/stream_out/rtp.c
index 55b6e49..34f6a09 100644
--- a/modules/stream_out/rtp.c
+++ b/modules/stream_out/rtp.c
@@ -164,7 +164,7 @@ static const char *const ppsz_protocols[] = {
 #define RTSP_HOST_LONGTEXT N_( \
     "This defines the address, port and path the RTSP VOD server will listen " \
     "on.\nSyntax is address:port/path. The default is to listen on all "\
-    "interfaces (address 0.0.0.0), on port 554, with no path.\nTo listen " \
+    "interfaces (address 0.0.0.0), on port 5544, with no path.\nTo listen " \
     "only on the local interface, use \"localhost\" as address." )
 
 #define RTSP_TIMEOUT_TEXT N_( "RTSP session timeout (s)" )
diff --git a/modules/stream_out/rtsp.c b/modules/stream_out/rtsp.c
index dcefe7c..382baa6 100644
--- a/modules/stream_out/rtsp.c
+++ b/modules/stream_out/rtsp.c
@@ -53,6 +53,8 @@
 
 #include "rtp.h"
 
+#define DEFAULT_RTSP_PORT 5544
+
 typedef struct rtsp_session_t rtsp_session_t;
 
 struct rtsp_stream_t
@@ -112,7 +114,7 @@ rtsp_stream_t *RtspSetup( vlc_object_t *owner, vod_media_t *media,
             goto error;
     }
 
-    rtsp->port = (url->i_port > 0) ? url->i_port : 554;
+    rtsp->port = (url->i_port > 0) ? url->i_port : DEFAULT_RTSP_PORT;
     rtsp->psz_path = strdup( ( url->psz_path != NULL ) ? url->psz_path : "/" );
     if( rtsp->psz_path == NULL )
         goto error;


Regards,

-- 
Pierre Ynard
"Une âme dans un corps, c'est comme un dessin sur une feuille de papier."



More information about the vlc-devel mailing list