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

RTC: Remove Object Cache Pool, no effect. 4.0.110

This commit is contained in:
winlin 2021-05-14 16:12:11 +08:00
parent d0951e2b43
commit f7b32252b0
16 changed files with 87 additions and 626 deletions

View file

@ -55,7 +55,7 @@ SrsRtpRingBuffer::~SrsRtpRingBuffer()
{
for (int i = 0; i < capacity_; ++i) {
SrsRtpPacket2* pkt = queue_[i];
_srs_rtp_cache->recycle(pkt);
srs_freep(pkt);
}
srs_freepa(queue_);
}
@ -80,10 +80,7 @@ void SrsRtpRingBuffer::advance_to(uint16_t seq)
void SrsRtpRingBuffer::set(uint16_t at, SrsRtpPacket2* pkt)
{
SrsRtpPacket2* p = queue_[at % capacity_];
if (p) {
_srs_rtp_cache->recycle(p);
}
srs_freep(p);
queue_[at % capacity_] = pkt;
}
@ -170,7 +167,7 @@ void SrsRtpRingBuffer::clear_histroy(uint16_t seq)
for (uint16_t i = 0; i < capacity_; i++) {
SrsRtpPacket2* p = queue_[i];
if (p && p->header.get_sequence() < seq) {
_srs_rtp_cache->recycle(p);
srs_freep(p);
queue_[i] = NULL;
}
}
@ -181,7 +178,7 @@ void SrsRtpRingBuffer::clear_all_histroy()
for (uint16_t i = 0; i < capacity_; i++) {
SrsRtpPacket2* p = queue_[i];
if (p) {
_srs_rtp_cache->recycle(p);
srs_freep(p);
queue_[i] = NULL;
}
}