兼容ssrc为0的rtp推流

This commit is contained in:
xiongziliang
2020-02-23 12:16:20 +08:00
parent 618b028da4
commit f76109c629
4 changed files with 14 additions and 11 deletions

View File

@@ -36,7 +36,7 @@ RtpSession::RtpSession(const Socket::Ptr &sock) : TcpSession(sock) {
}
RtpSession::~RtpSession() {
DebugP(this);
if(_ssrc){
if(_process){
RtpSelector::Instance().delProcess(_ssrc,_process.get());
}
}
@@ -66,11 +66,13 @@ void RtpSession::onManager() {
}
void RtpSession::onRtpPacket(const char *data, uint64_t len) {
if(!_ssrc){
_ssrc = RtpSelector::getSSRC(data + 2,len - 2);
if (!_process) {
if (!RtpSelector::getSSRC(data + 2, len - 2, _ssrc)) {
return;
}
_process = RtpSelector::Instance().getProcess(_ssrc, true);
}
_process->inputRtp(data + 2,len - 2,&addr);
_process->inputRtp(data + 2, len - 2, &addr);
_ticker.resetTime();
}