# HG changeset patch # User bertrand # Date 1140355647 0 # Node ID d6e575c86bb84b55ee431394946962cc975db89a # Parent a6a8b428753831bb4b1e97e4058781b39b5b4a0e Allows the LIVE555 library to forces the client's port to be used when reading from an RTP/RTSP source. Patch from Benjamin Zores and Patrick Labatut diff -r a6a8b4287538 -r d6e575c86bb8 DOCS/man/en/mplayer.1 --- a/DOCS/man/en/mplayer.1 Sun Feb 19 10:15:18 2006 +0000 +++ b/DOCS/man/en/mplayer.1 Sun Feb 19 13:27:27 2006 +0000 @@ -1346,6 +1346,12 @@ not pass incoming UDP packets (see http://www.live555.com/\:mplayer/). . .TP +.B \-rtsp-port (LIVE555 only) +Used with 'rtsp://' URLs to forces the client's port number. +This option may be useful if you're behind a router and want to forward the +RTSP stream from the server to a specific client. +. +.TP .B \-saveidx Force index rebuilding and dump the index to . Currently this only works with AVI files. diff -r a6a8b4287538 -r d6e575c86bb8 DOCS/man/fr/mplayer.1 --- a/DOCS/man/fr/mplayer.1 Sun Feb 19 10:15:18 2006 +0000 +++ b/DOCS/man/fr/mplayer.1 Sun Feb 19 13:27:27 2006 +0000 @@ -1426,6 +1426,13 @@ qui bloque les paquets UDP entrants (voir http://www.live.com/\:mplayer/). . .TP +.B \-rtsp-port (LIVE555 uniquement) +Utilisé avec 'rtsp://', URLs pour forcer l'utilisation d'un port particulier +au niveau du client. +Cette option peut être utile si vous êtes derrière un routeur et souhaitez +redistribuer le flux RTSP du serveur vers un client spécifique. +. +.TP .B \-saveidx Force la reconstruction de l'index et le sauvegarde dans . Pour l'instant cela ne fonctionne qu'avec les fichiers AVI. diff -r a6a8b4287538 -r d6e575c86bb8 cfg-mplayer.h --- a/cfg-mplayer.h Sun Feb 19 10:15:18 2006 +0000 +++ b/cfg-mplayer.h Sun Feb 19 13:27:27 2006 +0000 @@ -86,6 +86,7 @@ #ifdef STREAMING_LIVE555 extern int isSDPFile; extern int rtspStreamOverTCP; +extern int rtsp_port; #endif #ifdef HAVE_NEW_GUI @@ -296,8 +297,10 @@ {"sdp", "-sdp is obsolete, use sdp://file instead.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, // -rtsp-stream-over-tcp option, specifying TCP streaming of RTP/RTCP {"rtsp-stream-over-tcp", &rtspStreamOverTCP, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"rtsp-port", &rtsp_port, CONF_TYPE_INT, CONF_RANGE, -1, 65535, NULL}, #else {"rtsp-stream-over-tcp", "RTSP support requires the \"LIVE555 Streaming Media\" libraries.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {"rtsp-port", "RTSP support requires the \"LIVE555 Streaming Media\" libraries.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, #endif //---------------------- mplayer-only options ------------------------ diff -r a6a8b4287538 -r d6e575c86bb8 libmpdemux/demux_rtp.cpp --- a/libmpdemux/demux_rtp.cpp Sun Feb 19 10:15:18 2006 +0000 +++ b/libmpdemux/demux_rtp.cpp Sun Feb 19 13:27:27 2006 +0000 @@ -90,6 +90,7 @@ } int rtspStreamOverTCP = 0; +int rtsp_port = 0; extern "C" int audio_id, video_id, dvdsub_id; extern "C" demuxer_t* demux_open_rtp(demuxer_t* demuxer) { @@ -174,10 +175,13 @@ continue; } + if (rtsp_port) + subsession->setClientPortNum (rtsp_port); + if (!subsession->initiate()) { fprintf(stderr, "Failed to initiate \"%s/%s\" RTP subsession: %s\n", subsession->mediumName(), subsession->codecName(), env->getResultMsg()); } else { - fprintf(stderr, "Initiated \"%s/%s\" RTP subsession\n", subsession->mediumName(), subsession->codecName()); + fprintf(stderr, "Initiated \"%s/%s\" RTP subsession on port %d\n", subsession->mediumName(), subsession->codecName(), subsession->clientPortNum()); // Set the OS's socket receive buffer sufficiently large to avoid // incoming packets getting dropped between successive reads from this