- fixed problem with loss packet counter (it was higher than real value)

This commit is contained in:
2019-03-08 13:01:24 +02:00
parent dca4551222
commit 8e4f2152d2
4 changed files with 31 additions and 6 deletions

View File

@@ -79,6 +79,14 @@ int RtpHelper::findPtype(const void* buffer, size_t length)
return -1;
}
int RtpHelper::findPacketNo(const void *buffer, size_t length)
{
if (isRtp(buffer, length))
return ntohs(reinterpret_cast<const RtpHeader*>(buffer)->seq);
else
return -1;
}
int RtpHelper::findPayloadLength(const void* buffer, size_t length)
{
if (isRtp(buffer, length))

View File

@@ -35,6 +35,7 @@ class RtpHelper
public:
static bool isRtp(const void* buffer, size_t length);
static int findPtype(const void* buffer, size_t length);
static int findPacketNo(const void* buffer, size_t length);
static bool isRtpOrRtcp(const void* buffer, size_t length);
static bool isRtcp(const void* buffer, size_t length);
static unsigned findSsrc(const void* buffer, size_t length);