diff options
-rw-r--r-- | DOCS/man/en/mplayer.1 | 6 | ||||
-rw-r--r-- | DOCS/man/fr/mplayer.1 | 7 | ||||
-rw-r--r-- | cfg-mplayer.h | 3 | ||||
-rw-r--r-- | libmpdemux/demux_rtp.cpp | 6 |
4 files changed, 21 insertions, 1 deletions
diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index c2a225c887..780674c38a 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -1346,6 +1346,12 @@ This option may be useful if you have a broken internet connection that does 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 <filename> Force index rebuilding and dump the index to <filename>. Currently this only works with AVI files. diff --git a/DOCS/man/fr/mplayer.1 b/DOCS/man/fr/mplayer.1 index 789a3e98bb..da59560a09 100644 --- a/DOCS/man/fr/mplayer.1 +++ b/DOCS/man/fr/mplayer.1 @@ -1426,6 +1426,13 @@ Cette option peut être utile si vous avez une mauvaise connexion Internet 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 <nomfichier> Force la reconstruction de l'index et le sauvegarde dans <nomfichier>. Pour l'instant cela ne fonctionne qu'avec les fichiers AVI. diff --git a/cfg-mplayer.h b/cfg-mplayer.h index def74a24b9..10ca937753 100644 --- a/cfg-mplayer.h +++ b/cfg-mplayer.h @@ -86,6 +86,7 @@ extern m_option_t dxr2_opts[]; #ifdef STREAMING_LIVE555 extern int isSDPFile; extern int rtspStreamOverTCP; +extern int rtsp_port; #endif #ifdef HAVE_NEW_GUI @@ -296,8 +297,10 @@ m_option_t mplayer_opts[]={ {"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 --git a/libmpdemux/demux_rtp.cpp b/libmpdemux/demux_rtp.cpp index 5dfe7585c7..45291d6980 100644 --- a/libmpdemux/demux_rtp.cpp +++ b/libmpdemux/demux_rtp.cpp @@ -90,6 +90,7 @@ static char* openURL_sip(SIPClient* client, char const* url) { } 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 @@ extern "C" demuxer_t* demux_open_rtp(demuxer_t* demuxer) { 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 |