Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Volyntsev <xeioexception@gmail.com>2012-01-18 13:46:37 +0400
committerMichael Niedermayer <michaelni@gmx.at>2012-01-18 19:36:38 +0400
commitb29ec002bbec913ffdaad3f8dc482b36525a3de3 (patch)
treef57bdb62e9030b337d2270dc7beb30e848ac11d7 /libavformat/rtsp.c
parente49780f749b2ce8e229fb8257cd01f60e0661b54 (diff)
fix rtp 916 issue
Reviewed-by: Luca Abeni <lucabe72@email.it> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtsp.c')
-rw-r--r--libavformat/rtsp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index d32f49ed4c..ff1f85701b 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1103,7 +1103,7 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
int lower_transport, const char *real_challenge)
{
RTSPState *rt = s->priv_data;
- int rtx = 0, j, i, err, interleave = 0;
+ int rtx = 0, j, i, err, interleave = 0, port_off;
RTSPStream *rtsp_st;
RTSPMessageHeader reply1, *reply = &reply1;
char cmd[2048];
@@ -1120,8 +1120,11 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
/* for each stream, make the setup request */
/* XXX: we assume the same server is used for the control of each
* RTSP stream */
+ port_off = av_get_random_seed() % (RTSP_RTP_PORT_MAX - RTSP_RTP_PORT_MIN);
+ /* even random offset */
+ port_off -= port_off & 0x01;
- for (j = RTSP_RTP_PORT_MIN, i = 0; i < rt->nb_rtsp_streams; ++i) {
+ for (j = RTSP_RTP_PORT_MIN + port_off, i = 0; i < rt->nb_rtsp_streams; ++i) {
char transport[2048];
/*
@@ -1169,7 +1172,6 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
goto rtp_opened;
}
}
-
av_log(s, AV_LOG_ERROR, "Unable to open an input RTP port\n");
err = AVERROR(EIO);
goto fail;