# HG changeset patch # User lucabe # Date 1193731845 0 # Node ID 3dd4b622f4e3382ff765bac404995377470be66f # Parent 153d6efc05b8dfbed36bd03c0da375a47e09afb4 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) diff -r 153d6efc05b8 -r 3dd4b622f4e3 rtsp.c --- a/rtsp.c Tue Oct 30 00:01:25 2007 +0000 +++ b/rtsp.c Tue Oct 30 08:10:45 2007 +0000 @@ -934,8 +934,8 @@ 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; } }