修复openRtpServer开启tcp模式后打开端口失败的bug

两次监听同个tcp端口将导致打开tcp模式失败
This commit is contained in:
xia-chu 2023-10-23 20:45:58 +08:00
parent 08d86c498e
commit ebde21a314

View File

@ -161,7 +161,7 @@ void RtpServer::start(uint16_t local_port, const string &stream_id, TcpMode tcp_
if (local_port == 0) {
//随机端口rtp端口采用偶数
auto pair = std::make_pair(rtp_socket, rtcp_socket);
makeSockPair(pair, local_ip, re_use_port, TcpMode::NONE == tcp_mode);
makeSockPair(pair, local_ip, re_use_port);
local_port = rtp_socket->get_local_port();
} else if (!rtp_socket->bindUdpSock(local_port, local_ip, re_use_port)) {
//用户指定端口