[FFmpeg-cvslog] avformat/libsrt: send non-blocking mode on both the listen and the connect socket

Marton Balint git at videolan.org
Mon Feb 24 01:14:56 EET 2020


ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Fri Feb 14 23:50:34 2020 +0100| [7cc7680a802c1eee9e334a0653f2347e9c0922a4] | committer: Marton Balint

avformat/libsrt: send non-blocking mode on both the listen and the connect socket

Signed-off-by: Marton Balint <cus at passwd.hu>

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

 libavformat/libsrt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavformat/libsrt.c b/libavformat/libsrt.c
index c3c96b35e0..fe3e7d4207 100644
--- a/libavformat/libsrt.c
+++ b/libavformat/libsrt.c
@@ -249,9 +249,6 @@ static int libsrt_listen_connect(int eid, int fd, const struct sockaddr *addr, s
 {
     int ret;
 
-    if (libsrt_socket_nonblock(fd, 1) < 0)
-        av_log(h, AV_LOG_DEBUG, "ff_socket_nonblock failed\n");
-
     ret = srt_connect(fd, addr, addrlen);
     if (ret < 0)
         return libsrt_neterrno(h);
@@ -432,6 +429,9 @@ static int libsrt_setup(URLContext *h, const char *uri, int flags)
     if (s->send_buffer_size > 0) {
         srt_setsockopt(fd, SOL_SOCKET, SRTO_UDP_SNDBUF, &s->send_buffer_size, sizeof (s->send_buffer_size));
     }
+    if (libsrt_socket_nonblock(fd, 1) < 0)
+        av_log(h, AV_LOG_DEBUG, "libsrt_socket_nonblock failed\n");
+
     if (s->mode == SRT_MODE_LISTENER) {
         // multi-client
         if ((ret = libsrt_listen(s->eid, fd, cur_ai->ai_addr, cur_ai->ai_addrlen, h, open_timeout)) < 0)



More information about the ffmpeg-cvslog mailing list