Commit c9261619 authored by lucabe's avatar lucabe

If local port n is not available, try n + 2 instead of continuing to bind

on n (allow to receive 2 rtsp streams simultaneously with libavformat)


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@10876 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent d3139ed5
......@@ -934,8 +934,8 @@ static int rtsp_read_header(AVFormatContext *s,
if (RTSP_RTP_PORT_MIN != 0) {
while(j <= RTSP_RTP_PORT_MAX) {
snprintf(buf, sizeof(buf), "rtp://?localport=%d", j);
j += 2; /* we will use two port by rtp stream (rtp and rtcp) */
if (url_open(&rtsp_st->rtp_handle, buf, URL_RDWR) == 0) {
j += 2; /* we will use two port by rtp stream (rtp and rtcp) */
goto rtp_opened;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment