忽略非法的rtp/rtcp包
This commit is contained in:
parent
3d16f55446
commit
dc67665784
|
|
@ -1041,8 +1041,13 @@ inline void RtspSession::onRcvPeerUdpData(int intervaled, const Buffer::Ptr &pBu
|
||||||
|
|
||||||
inline void RtspSession::startListenPeerUdpData(int trackIdx) {
|
inline void RtspSession::startListenPeerUdpData(int trackIdx) {
|
||||||
weak_ptr<RtspSession> weakSelf = dynamic_pointer_cast<RtspSession>(shared_from_this());
|
weak_ptr<RtspSession> weakSelf = dynamic_pointer_cast<RtspSession>(shared_from_this());
|
||||||
|
auto srcIP = inet_addr(get_peer_ip().data());
|
||||||
auto onUdpData = [weakSelf](const Buffer::Ptr &pBuf, struct sockaddr *pPeerAddr,int intervaled){
|
auto onUdpData = [weakSelf,srcIP](const Buffer::Ptr &pBuf, struct sockaddr *pPeerAddr,int intervaled){
|
||||||
|
if (((struct sockaddr_in *) pPeerAddr)->sin_addr.s_addr != srcIP) {
|
||||||
|
WarnL << ((intervaled % 2 == 0) ? "收到其他地址的rtp数据:" : "收到其他地址的rtcp数据:")
|
||||||
|
<< inet_ntoa(((struct sockaddr_in *) pPeerAddr)->sin_addr);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
auto strongSelf=weakSelf.lock();
|
auto strongSelf=weakSelf.lock();
|
||||||
if(!strongSelf) {
|
if(!strongSelf) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue