mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
RTC: Fix object cache bug, reset payload when recycle
This commit is contained in:
parent
3d4d250eb9
commit
4d5c7e0a73
2 changed files with 18 additions and 2 deletions
|
@ -1078,6 +1078,12 @@ SrsRtpRawPayload::~SrsRtpRawPayload()
|
|||
{
|
||||
}
|
||||
|
||||
bool SrsRtpRawPayload::recycle()
|
||||
{
|
||||
payload=NULL; nn_payload=0;
|
||||
return true;
|
||||
}
|
||||
|
||||
uint64_t SrsRtpRawPayload::nb_bytes()
|
||||
{
|
||||
return nn_payload;
|
||||
|
@ -1538,6 +1544,16 @@ SrsRtpFUAPayload2::~SrsRtpFUAPayload2()
|
|||
{
|
||||
}
|
||||
|
||||
bool SrsRtpFUAPayload2::recycle()
|
||||
{
|
||||
start = end = false;
|
||||
nri = nalu_type = (SrsAvcNaluType)0;
|
||||
|
||||
payload = NULL;
|
||||
size = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
uint64_t SrsRtpFUAPayload2::nb_bytes()
|
||||
{
|
||||
return 2 + size;
|
||||
|
|
|
@ -473,7 +473,7 @@ public:
|
|||
SrsRtpRawPayload();
|
||||
virtual ~SrsRtpRawPayload();
|
||||
public:
|
||||
bool recycle() { return true; }
|
||||
bool recycle();
|
||||
// interface ISrsRtpPayloader
|
||||
public:
|
||||
virtual uint64_t nb_bytes();
|
||||
|
@ -573,7 +573,7 @@ public:
|
|||
SrsRtpFUAPayload2();
|
||||
virtual ~SrsRtpFUAPayload2();
|
||||
public:
|
||||
bool recycle() { return true; }
|
||||
bool recycle();
|
||||
// interface ISrsRtpPayloader
|
||||
public:
|
||||
virtual uint64_t nb_bytes();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue