复用rtp/rtcp判断逻辑过滤非rtp包: #2247

This commit is contained in:
xiongziliang
2023-02-28 22:23:30 +08:00
parent dc8508c58f
commit c2e1083493
5 changed files with 31 additions and 21 deletions

View File

@@ -70,14 +70,9 @@ RtpProcess::~RtpProcess() {
}
}
static bool is_rtp(const char *buf) {
RtpHeader *header = (RtpHeader *)buf;
return ((header->pt < 64) || (header->pt >= 96));
}
bool RtpProcess::inputRtp(bool is_udp, const Socket::Ptr &sock, const char *data, size_t len, const struct sockaddr *addr, uint64_t *dts_out) {
if (!is_rtp(data)) {
WarnL << "Not rtp packet";
if (!isRtp(data, len)) {
WarnP(this) << "Not rtp packet";
return false;
}
if (_sock != sock) {