diff --git a/src/zm_rtp_ctrl.cpp b/src/zm_rtp_ctrl.cpp index af995330dd..07b4f631cc 100644 --- a/src/zm_rtp_ctrl.cpp +++ b/src/zm_rtp_ctrl.cpp @@ -243,6 +243,10 @@ int RtpCtrlThread::recvPackets( unsigned char *buffer, ssize_t nBytes ) { } void RtpCtrlThread::Run() { + if (mRtpSource.getLocalCtrlPort()<=1024) { + Debug(2, "Not starting control thread"); + return; + } Debug( 2, "Starting control thread %x on port %d", mRtpSource.getSsrc(), mRtpSource.getLocalCtrlPort() ); zm::SockAddrInet localAddr, remoteAddr; diff --git a/src/zm_rtp_data.cpp b/src/zm_rtp_data.cpp index f9b61d8591..d51cb30ad7 100644 --- a/src/zm_rtp_data.cpp +++ b/src/zm_rtp_data.cpp @@ -59,6 +59,10 @@ bool RtpDataThread::recvPacket(const unsigned char *packet, size_t packetLen) { } void RtpDataThread::Run() { + if (mRtpSource.getLocalDataPort()<=1024) { + Debug(2, "Not starting data thread"); + return; + } Debug(2, "Starting data thread %d on port %d", mRtpSource.getSsrc(), mRtpSource.getLocalDataPort()); @@ -66,12 +70,13 @@ void RtpDataThread::Run() { zm::UdpInetServer rtpDataSocket; if ( mRtpSource.getLocalHost() != "" ) { if ( !rtpDataSocket.bind(mRtpSource.getLocalHost().c_str(), mRtpSource.getLocalDataPort()) ) - Fatal("Failed to bind RTP server"); + Fatal("Failed to bind RTP server at %s:%d", mRtpSource.getLocalHost().c_str(), mRtpSource.getLocalDataPort()); } else { if ( !rtpDataSocket.bind( mRtspThread.getAddressFamily() == AF_INET6 ? "::" : "0.0.0.0", mRtpSource.getLocalDataPort() ) ) - Fatal("Failed to bind RTP server"); + Fatal("Failed to bind RTP server at %s:%d", + (mRtspThread.getAddressFamily() == AF_INET6 ? "::" : "0.0.0.0"), mRtpSource.getLocalDataPort()); } Debug(3, "Bound to %s:%d", mRtpSource.getLocalHost().c_str(), mRtpSource.getLocalDataPort());