From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 829BB49990 for ; Sat, 24 Feb 2024 21:19:01 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A339E68C6CE; Sat, 24 Feb 2024 23:18:57 +0200 (EET) Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3204668BF78 for ; Sat, 24 Feb 2024 23:18:50 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 9818BE9665 for ; Sat, 24 Feb 2024 22:18:49 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xOAP6AaM4vYX for ; Sat, 24 Feb 2024 22:18:47 +0100 (CET) Received: from iq (iq [217.27.212.140]) by iq.passwd.hu (Postfix) with ESMTPS id 17ED0E9648 for ; Sat, 24 Feb 2024 22:18:47 +0100 (CET) Date: Sat, 24 Feb 2024 22:18:47 +0100 (CET) From: Marton Balint To: FFmpeg development discussions and patches In-Reply-To: <20240220214442.19325-1-cus@passwd.hu> Message-ID: References: <20240220214442.19325-1-cus@passwd.hu> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH] avformat/libsrt: use SRT_EPOLL_IN for waiting for an incoming connection X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Tue, 20 Feb 2024, Marton Balint wrote: > This is the proper poll mode for waiting for an incoming connection according > to the SRT API docs. > > Fixes ticket #9142. Will apply. Regards, Marton > > Signed-off-by: Marton Balint > --- > libavformat/libsrt.c | 17 ++++++++++------- > 1 file changed, 10 insertions(+), 7 deletions(-) > > diff --git a/libavformat/libsrt.c b/libavformat/libsrt.c > index 56acb6e741..0edea9266d 100644 > --- a/libavformat/libsrt.c > +++ b/libavformat/libsrt.c > @@ -250,7 +250,7 @@ static int libsrt_listen(int eid, int fd, const struct sockaddr *addr, socklen_t > if (srt_listen(fd, 1)) > return libsrt_neterrno(h); > > - ret = libsrt_network_wait_fd_timeout(h, eid, 1, timeout, &h->interrupt_callback); > + ret = libsrt_network_wait_fd_timeout(h, eid, 0, timeout, &h->interrupt_callback); > if (ret < 0) > return ret; > > @@ -391,7 +391,7 @@ static int libsrt_setup(URLContext *h, const char *uri, int flags) > char hostname[1024],proto[1024],path[1024]; > char portstr[10]; > int64_t open_timeout = 0; > - int eid, write_eid; > + int eid; > > av_url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname), > &port, path, sizeof(path), uri); > @@ -455,18 +455,21 @@ static int libsrt_setup(URLContext *h, const char *uri, int flags) > if (libsrt_socket_nonblock(fd, 1) < 0) > av_log(h, AV_LOG_DEBUG, "libsrt_socket_nonblock failed\n"); > > - ret = write_eid = libsrt_epoll_create(h, fd, 1); > - if (ret < 0) > - goto fail1; > if (s->mode == SRT_MODE_LISTENER) { > + int read_eid = ret = libsrt_epoll_create(h, fd, 0); > + if (ret < 0) > + goto fail1; > // multi-client > - ret = libsrt_listen(write_eid, fd, cur_ai->ai_addr, cur_ai->ai_addrlen, h, s->listen_timeout); > - srt_epoll_release(write_eid); > + ret = libsrt_listen(read_eid, fd, cur_ai->ai_addr, cur_ai->ai_addrlen, h, s->listen_timeout); > + srt_epoll_release(read_eid); > if (ret < 0) > goto fail1; > srt_close(fd); > fd = ret; > } else { > + int write_eid = ret = libsrt_epoll_create(h, fd, 1); > + if (ret < 0) > + goto fail1; > if (s->mode == SRT_MODE_RENDEZVOUS) { > if (srt_bind(fd, cur_ai->ai_addr, cur_ai->ai_addrlen)) { > ret = libsrt_neterrno(h); > -- > 2.35.3 > > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". > _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".