diff mbox series

[FFmpeg-devel,v2,7/9] avformat/libsrt: use listen_timeout for listening

Message ID 20200217003653.20027-7-cus@passwd.hu
State New
Headers show
Series [FFmpeg-devel,v2,1/9] avformat/libsrt: fix timeout unit confusion between milisec and microsec
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Marton Balint Feb. 17, 2020, 12:36 a.m. UTC
Signed-off-by: Marton Balint <cus@passwd.hu>
---
 libavformat/libsrt.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/libsrt.c b/libavformat/libsrt.c
index fe3e7d4207..f24ce46831 100644
--- a/libavformat/libsrt.c
+++ b/libavformat/libsrt.c
@@ -227,14 +227,9 @@  static int libsrt_listen(int eid, int fd, const struct sockaddr *addr, socklen_t
     if (ret)
         return libsrt_neterrno(h);
 
-    while ((ret = libsrt_network_wait_fd_timeout(h, eid, fd, 1, timeout, &h->interrupt_callback))) {
-        switch (ret) {
-        case AVERROR(ETIMEDOUT):
-            continue;
-        default:
-            return ret;
-        }
-    }
+    ret = libsrt_network_wait_fd_timeout(h, eid, fd, 1, timeout, &h->interrupt_callback);
+    if (ret < 0)
+        return ret;
 
     ret = srt_accept(fd, NULL, NULL);
     if (ret < 0)
@@ -434,7 +429,7 @@  static int libsrt_setup(URLContext *h, const char *uri, int flags)
 
     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)
+        if ((ret = libsrt_listen(s->eid, fd, cur_ai->ai_addr, cur_ai->ai_addrlen, h, s->listen_timeout)) < 0)
             goto fail1;
         fd = ret;
     } else {