1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

RTC: Only cache the UDP packet message

This commit is contained in:
winlin 2021-02-26 22:55:27 +08:00
parent e79293a3bc
commit 30809aee60
6 changed files with 34 additions and 11 deletions

View file

@ -361,8 +361,12 @@ SrsSharedPtrMessage* SrsSharedPtrMessage::copy()
{
srs_assert(ptr);
SrsSharedPtrMessage* copy = _srs_rtp_msg_cache->allocate();
SrsSharedPtrMessage* copy = _srs_rtp_msg_cache2->allocate();
// We got an object from cache, the ptr might exists, so unwrap it.
copy->unwrap();
// Reference to this message instead.
copy->ptr = ptr;
ptr->shared_count++;