1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

rtsp: Remove a leftover, currently pointless check

This check isn't relevant in the way the code currently works.

Also change a case of if (x == 0) into if (!x).

Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Dmitry Volyntsev 2012-01-18 13:54:16 +04:00 committed by Martin Storsjö
parent ad7beb2cac
commit bc495bad3d

View File

@ -1158,16 +1158,14 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
}
/* first try in specified port range */
if (RTSP_RTP_PORT_MIN != 0) {
while (j <= RTSP_RTP_PORT_MAX) {
ff_url_join(buf, sizeof(buf), "rtp", NULL, host, -1,
"?localport=%d", j);
/* we will use two ports per rtp stream (rtp and rtcp) */
j += 2;
if (ffurl_open(&rtsp_st->rtp_handle, buf, AVIO_FLAG_READ_WRITE,
&s->interrupt_callback, NULL) == 0)
goto rtp_opened;
}
while (j <= RTSP_RTP_PORT_MAX) {
ff_url_join(buf, sizeof(buf), "rtp", NULL, host, -1,
"?localport=%d", j);
/* we will use two ports per rtp stream (rtp and rtcp) */
j += 2;
if (!ffurl_open(&rtsp_st->rtp_handle, buf, AVIO_FLAG_READ_WRITE,
&s->interrupt_callback, NULL))
goto rtp_opened;
}
av_log(s, AV_LOG_ERROR, "Unable to open an input RTP port\n");