Ticket #916: 0002-fix-rtp-916-issue-patch-2.patch

File 0002-fix-rtp-916-issue-patch-2.patch, 1.7 KB (added by Dmitry Volyntsev, 14 years ago)

final committed patch 2

  • libavformat/rtsp.c

    From bf86e4b6ec9454cb7df2675d5269d82c0644afac Mon Sep 17 00:00:00 2001
    From: Dmitry Volyntsev <xeioexception@gmail.com>
    Date: Wed, 18 Jan 2012 13:54:16 +0400
    Subject: [PATCH 2/2] fix rtp 916 issue, patch 2
    
    ---
     libavformat/rtsp.c |   18 ++++++++----------
     1 files changed, 8 insertions(+), 10 deletions(-)
    
    diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
    index ff1f857..56e5de2 100644
    a b int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,  
    11611161            }
    11621162
    11631163            /* first try in specified port range */
    1164             if (RTSP_RTP_PORT_MIN != 0) {
    1165                 while (j <= RTSP_RTP_PORT_MAX) {
    1166                     ff_url_join(buf, sizeof(buf), "rtp", NULL, host, -1,
    1167                                 "?localport=%d", j);
    1168                     /* we will use two ports per rtp stream (rtp and rtcp) */
    1169                     j += 2;
    1170                     if (ffurl_open(&rtsp_st->rtp_handle, buf, AVIO_FLAG_READ_WRITE,
    1171                                    &s->interrupt_callback, NULL) == 0)
    1172                         goto rtp_opened;
    1173                 }
     1164            while (j <= RTSP_RTP_PORT_MAX) {
     1165                ff_url_join(buf, sizeof(buf), "rtp", NULL, host, -1,
     1166                            "?localport=%d", j);
     1167                /* we will use two ports per rtp stream (rtp and rtcp) */
     1168                j += 2;
     1169                if (!ffurl_open(&rtsp_st->rtp_handle, buf, AVIO_FLAG_READ_WRITE,
     1170                               &s->interrupt_callback, NULL))
     1171                    goto rtp_opened;
    11741172            }
    11751173            av_log(s, AV_LOG_ERROR, "Unable to open an input RTP port\n");
    11761174            err = AVERROR(EIO);