From b45bb22ccc4b4ea00ae8311b2a981f6391b2e2cf Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Thu, 31 May 2018 16:34:16 +0200 Subject: [PATCH] RTP UDP: do not use separate thread on MSW Do not use separate receiving thread on MSW because it causes freezes when the thread is waiting on read() and different thread wants to set/get different properties of the socket - eg. setsockopt(SO_RCVBUF) or getsockname(). --- src/video_rxtx/rtp.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/video_rxtx/rtp.cpp b/src/video_rxtx/rtp.cpp index 7893ea449..e7fe34e49 100644 --- a/src/video_rxtx/rtp.cpp +++ b/src/video_rxtx/rtp.cpp @@ -326,10 +326,16 @@ struct rtp **rtp_video_rxtx::initialize_network(const char *addrs, int recv_port if (send_port == send_port_base + 2) send_port += 2; +#if !defined WIN32 + const bool multithreaded = true; +#else + const bool multithreaded = false; +#endif + devices[index] = rtp_init_if(addr, mcast_if, recv_port, send_port, ttl, rtcp_bw, FALSE, rtp_recv_callback, (uint8_t *)participants, - use_ipv6, true); + use_ipv6, multithreaded); if (devices[index] != NULL) { rtp_set_option(devices[index], RTP_OPT_WEAK_VALIDATION, TRUE);