[FFmpeg-cvslog] r10876 - trunk/libavformat/rtsp.c

lucabe subversion
Tue Oct 30 09:10:45 CET 2007


Author: lucabe
Date: Tue Oct 30 09:10:45 2007
New Revision: 10876

Log:
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)


Modified:
   trunk/libavformat/rtsp.c

Modified: trunk/libavformat/rtsp.c
==============================================================================
--- trunk/libavformat/rtsp.c	(original)
+++ trunk/libavformat/rtsp.c	Tue Oct 30 09:10:45 2007
@@ -934,8 +934,8 @@ static int rtsp_read_header(AVFormatCont
             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;
                     }
                 }




More information about the ffmpeg-cvslog mailing list