优化代码

This commit is contained in:
xiongziliang
2020-10-18 21:39:22 +08:00
parent 51fcaeda4c
commit e3364e9029
3 changed files with 12 additions and 7 deletions

View File

@@ -59,7 +59,7 @@ void RtpSession::onManager() {
void RtpSession::onRtpPacket(const char *data, uint64_t len) {
if (!_process) {
uint32_t ssrc;
if (!RtpSelector::getSSRC(data + 2, len - 2, ssrc)) {
if (!RtpSelector::getSSRC(data, len, ssrc)) {
return;
}
if (_stream_id.empty()) {
@@ -70,7 +70,7 @@ void RtpSession::onRtpPacket(const char *data, uint64_t len) {
_process = RtpSelector::Instance().getProcess(_stream_id, true);
_process->setListener(dynamic_pointer_cast<RtpSession>(shared_from_this()));
}
_process->inputRtp(getSock(), data + 2, len - 2, &addr);
_process->inputRtp(getSock(), data, len, &addr);
_ticker.resetTime();
}