mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-12-02 00:12:33 +08:00
确保rtp端口为偶数,rtcp端口为奇数
This commit is contained in:
parent
517f3c229c
commit
2eb64d2c39
@ -277,6 +277,13 @@ void RtspPlayer::createUdpSockIfNecessary(int track_idx){
|
|||||||
throw std::runtime_error("open rtcp sock failed");
|
throw std::runtime_error("open rtcp sock failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(rtpSockRef->get_local_port() % 2 != 0){
|
||||||
|
//如果rtp端口不是偶数,那么与rtcp端口互换,目的是兼容一些要求严格的服务器
|
||||||
|
Socket::Ptr tmp = rtpSockRef;
|
||||||
|
rtpSockRef = rtcpSockRef;
|
||||||
|
rtcpSockRef = tmp;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user