From 48788cf25bcc9fae1cdeb492e1b41184aadbd2d8 Mon Sep 17 00:00:00 2001 From: sunhui Date: Sat, 28 Nov 2020 02:39:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3RtpServer=E5=90=AF=E5=8A=A8UD?= =?UTF-8?q?PServer=E6=94=B6=E6=B5=81=E9=80=A0=E6=88=90=E5=B4=A9=E6=BA=83?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtp/RtpServer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Rtp/RtpServer.cpp b/src/Rtp/RtpServer.cpp index 16196fdf..d192416d 100644 --- a/src/Rtp/RtpServer.cpp +++ b/src/Rtp/RtpServer.cpp @@ -24,10 +24,10 @@ RtpServer::~RtpServer() { void RtpServer::start(uint16_t local_port, const string &stream_id, bool enable_tcp, const char *local_ip) { //创建udp服务器 - Socket::Ptr udp_server = Socket::createSocket(nullptr, false); + Socket::Ptr udp_server = Socket::createSocket(nullptr, true); if (local_port == 0) { //随机端口,rtp端口采用偶数 - Socket::Ptr rtcp_server = Socket::createSocket(nullptr, false); + Socket::Ptr rtcp_server = Socket::createSocket(nullptr, true); auto pair = std::make_pair(udp_server, rtcp_server); makeSockPair(pair, local_ip); //取偶数端口