diff options
author | Marton Balint <cus@passwd.hu> | 2021-01-31 00:25:14 +0100 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2021-02-07 19:42:22 +0100 |
commit | 5cf01ed5cdfafbb494ca1725b5408555abc9f223 (patch) | |
tree | 5235d2cc7bb5e1dafc8b87527abfeb404238cf3f /libavformat/libsrt.c | |
parent | d4e4ffd348ca39b66c79007ad1961f3303781d52 (diff) | |
download | ffmpeg-5cf01ed5cdfafbb494ca1725b5408555abc9f223.tar.gz |
avformat/libsrt: fix or simplify some function return values
Sometimes there was a confusion between srt_*() function return values and
libavformat-style return values.
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavformat/libsrt.c')
-rw-r--r-- | libavformat/libsrt.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/libavformat/libsrt.c b/libavformat/libsrt.c index 28c06f130e..f10b043c36 100644 --- a/libavformat/libsrt.c +++ b/libavformat/libsrt.c @@ -219,12 +219,10 @@ static int libsrt_listen(int eid, int fd, const struct sockaddr *addr, socklen_t if (srt_setsockopt(fd, SOL_SOCKET, SRTO_REUSEADDR, &reuse, sizeof(reuse))) { av_log(h, AV_LOG_WARNING, "setsockopt(SRTO_REUSEADDR) failed\n"); } - ret = srt_bind(fd, addr, addrlen); - if (ret) + if (srt_bind(fd, addr, addrlen)) return libsrt_neterrno(h); - ret = srt_listen(fd, 1); - if (ret) + if (srt_listen(fd, 1)) return libsrt_neterrno(h); ret = libsrt_network_wait_fd_timeout(h, eid, fd, 1, timeout, &h->interrupt_callback); @@ -244,8 +242,7 @@ static int libsrt_listen_connect(int eid, int fd, const struct sockaddr *addr, s { int ret; - ret = srt_connect(fd, addr, addrlen); - if (ret < 0) + if (srt_connect(fd, addr, addrlen) < 0) return libsrt_neterrno(h); ret = libsrt_network_wait_fd_timeout(h, eid, fd, 1, timeout, &h->interrupt_callback); @@ -443,9 +440,10 @@ static int libsrt_setup(URLContext *h, const char *uri, int flags) fd = ret; } else { if (s->mode == SRT_MODE_RENDEZVOUS) { - ret = srt_bind(fd, cur_ai->ai_addr, cur_ai->ai_addrlen); - if (ret) + if (srt_bind(fd, cur_ai->ai_addr, cur_ai->ai_addrlen)) { + ret = libsrt_neterrno(h); goto fail1; + } } if ((ret = libsrt_listen_connect(s->eid, fd, cur_ai->ai_addr, cur_ai->ai_addrlen, |