This check isn't relevant in the way the code currently works. Also change a case of if (x == 0) into if (!x).
Unified · Split
| @@ -1158,16 +1158,14 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port, · 1157 unmodified lines | |||
| 1158 | } | 1158 | } |
| 1159 | 1159 | ||
| 1160 | /* first try in specified port range */ | 1160 | /* first try in specified port range */ |
| 1161 | if (RTSP_RTP_PORT_MIN != 0) { | 1161 | while (j <= RTSP_RTP_PORT_MAX) { |
| 1162 | while (j <= RTSP_RTP_PORT_MAX) { | 1162 | ff_url_join(buf, sizeof(buf), "rtp", NULL, host, -1, |
| 1163 | ff_url_join(buf, sizeof(buf), "rtp", NULL, host, -1, | 1163 | "?localport=%d", j); |
| 1164 | "?localport=%d", j); | 1164 | /* we will use two ports per rtp stream (rtp and rtcp) */ |
| 1165 | /* we will use two ports per rtp stream (rtp and rtcp) */ | 1165 | j += 2; |
| 1166 | j += 2; | 1166 | if (!ffurl_open(&rtsp_st->rtp_handle, buf, AVIO_FLAG_READ_WRITE, |
| 1167 | if (ffurl_open(&rtsp_st->rtp_handle, buf, AVIO_FLAG_READ_WRITE, | 1167 | &s->interrupt_callback, NULL)) |
| 1168 | &s->interrupt_callback, NULL) == 0) | 1168 | goto rtp_opened; |
| 1169 | goto rtp_opened; | ||
| 1170 | } | ||
| 1171 | } | 1169 | } |
| 1172 | 1170 | ||
| 1173 | av_log(s, AV_LOG_ERROR, "Unable to open an input RTP port\n"); | 1171 | av_log(s, AV_LOG_ERROR, "Unable to open an input RTP port\n"); |