mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-23 03:10:04 +08:00
Merge branch 'master' of https://gitee.com/xia-chu/ZLMediaKit into open_src
This commit is contained in:
commit
a5b4da7db5
@ -24,10 +24,10 @@ RtpServer::~RtpServer() {
|
|||||||
|
|
||||||
void RtpServer::start(uint16_t local_port, const string &stream_id, bool enable_tcp, const char *local_ip) {
|
void RtpServer::start(uint16_t local_port, const string &stream_id, bool enable_tcp, const char *local_ip) {
|
||||||
//创建udp服务器
|
//创建udp服务器
|
||||||
Socket::Ptr udp_server = Socket::createSocket(nullptr, false);
|
Socket::Ptr udp_server = Socket::createSocket(nullptr, true);
|
||||||
if (local_port == 0) {
|
if (local_port == 0) {
|
||||||
//随机端口,rtp端口采用偶数
|
//随机端口,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);
|
auto pair = std::make_pair(udp_server, rtcp_server);
|
||||||
makeSockPair(pair, local_ip);
|
makeSockPair(pair, local_ip);
|
||||||
//取偶数端口
|
//取偶数端口
|
||||||
|
Loading…
Reference in New Issue
Block a user