mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 19:00:01 +08:00
parent
a981ce8cb3
commit
8f108395a5
@ -70,7 +70,16 @@ 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) {
|
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";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (_sock != sock) {
|
if (_sock != sock) {
|
||||||
// 第一次运行本函数
|
// 第一次运行本函数
|
||||||
bool first = !_sock;
|
bool first = !_sock;
|
||||||
|
Loading…
Reference in New Issue
Block a user