[FFmpeg-cvslog] rtsp: Remove a leftover, currently pointless check

Dmitry Volyntsev git at videolan.org
Mon Jan 23 01:18:09 CET 2012


ffmpeg | branch: master | Dmitry Volyntsev <xeioexception at gmail.com> | Wed Jan 18 13:54:16 2012 +0400| [bc495bad3d8cbae71c82142906f7d36baf25a848] | committer: Martin Storsjö

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 at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bc495bad3d8cbae71c82142906f7d36baf25a848
---

 libavformat/rtsp.c |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 2858a9a..77aeb63 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -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");



More information about the ffmpeg-cvslog mailing list