diff --git a/src/Rtsp/Rtsp.cpp b/src/Rtsp/Rtsp.cpp index f4d79462..b55c1d0e 100644 --- a/src/Rtsp/Rtsp.cpp +++ b/src/Rtsp/Rtsp.cpp @@ -373,7 +373,7 @@ std::pair makeSockPair_l(const EventPoller::Ptr &polle } //是否是偶数 - bool even_numbers = pSockRtp->get_local_port() % 2 != 0; + bool even_numbers = pSockRtp->get_local_port() % 2 == 0; auto pSockRtcp = std::make_shared(poller); if (!pSockRtcp->bindUdpSock(pSockRtp->get_local_port() + (even_numbers ? 1 : -1), local_ip.data())) { //分配端口失败