| 1160 | | /* first try in specified port range */ |
| 1161 | | if (RTSP_RTP_PORT_MIN != 0) { |
| 1162 | | while (j <= RTSP_RTP_PORT_MAX) { |
| 1163 | | ff_url_join(buf, sizeof(buf), "rtp", NULL, host, -1, |
| 1164 | | "?localport=%d", j); |
| 1165 | | /* we will use two ports per rtp stream (rtp and rtcp) */ |
| 1166 | | j += 2; |
| 1167 | | if (ffurl_open(&rtsp_st->rtp_handle, buf, AVIO_FLAG_READ_WRITE, |
| 1168 | | &s->interrupt_callback, NULL) == 0) |
| 1169 | | goto rtp_opened; |
| 1170 | | } |
| 1171 | | } |
| | 1160 | /* OS will choose local port by itself */ |
| | 1161 | ff_url_join(buf, sizeof(buf), "rtp", NULL, host, -1, |
| | 1162 | "?localport=%d", 0); |
| | 1163 | /* we will use two ports per rtp stream (rtp and rtcp) */ |
| | 1164 | j += 2; |
| | 1165 | if (ffurl_open(&rtsp_st->rtp_handle, buf, AVIO_FLAG_READ_WRITE, |
| | 1166 | &s->interrupt_callback, NULL) == 0) |
| | 1167 | goto rtp_opened; |