---
 libavformat/rtsp.c | 50 +++++++++++++++++++++++++-------------------------
 1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 03608c8..e3b8a7a 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1921,33 +1921,33 @@ static int udp_read_packet(AVFormatContext *s, 
RTSPStream **prtsp_st,
         p = rt->p = av_malloc_array(2 * (rt->nb_rtsp_streams + 1), 
sizeof(struct pollfd));
         if (!p)
             return AVERROR(ENOMEM);
-    }
 
-    if (rt->rtsp_hd) {
-        tcp_fd = ffurl_get_file_handle(rt->rtsp_hd);
-        p[max_p].fd = tcp_fd;
-        p[max_p++].events = POLLIN;
-    } else {
-        tcp_fd = -1;
-    }
-    for (i = 0; i < rt->nb_rtsp_streams; i++) {
-        rtsp_st = rt->rtsp_streams[i];
-        if (rtsp_st->rtp_handle) {
-            if (ret = ffurl_get_multi_file_handle(rtsp_st->rtp_handle,
-                                                  &fds, &fdsnum)) {
-                av_log(s, AV_LOG_ERROR, "Unable to recover rtp ports\n");
-                return ret;
-            }
-            if (fdsnum != 2) {
-                av_log(s, AV_LOG_ERROR,
-                       "Number of fds %d not supported\n", fdsnum);
-                return AVERROR_INVALIDDATA;
-            }
-            for (fdsidx = 0; fdsidx < fdsnum; fdsidx++) {
-                p[max_p].fd       = fds[fdsidx];
-                p[max_p++].events = POLLIN;
+        if (rt->rtsp_hd) {
+            tcp_fd = ffurl_get_file_handle(rt->rtsp_hd);
+            p[max_p].fd = tcp_fd;
+            p[max_p++].events = POLLIN;
+        } else {
+            tcp_fd = -1;
+        }
+        for (i = 0; i < rt->nb_rtsp_streams; i++) {
+            rtsp_st = rt->rtsp_streams[i];
+            if (rtsp_st->rtp_handle) {
+                if (ret = ffurl_get_multi_file_handle(rtsp_st->rtp_handle,
+                                                      &fds, &fdsnum)) {
+                    av_log(s, AV_LOG_ERROR, "Unable to recover rtp ports\n");
+                    return ret;
+                }
+                if (fdsnum != 2) {
+                    av_log(s, AV_LOG_ERROR,
+                           "Number of fds %d not supported\n", fdsnum);
+                    return AVERROR_INVALIDDATA;
+                }
+                for (fdsidx = 0; fdsidx < fdsnum; fdsidx++) {
+                    p[max_p].fd       = fds[fdsidx];
+                    p[max_p++].events = POLLIN;
+                }
+                av_free(fds);
             }
-            av_free(fds);
         }
     }
 
-- 
2.9.2

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to