mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-23 11:17:09 +08:00
优化rtmp内存估算
This commit is contained in:
parent
a97b7ce701
commit
8f10cdbacd
@ -202,7 +202,7 @@ void RtmpProtocol::sendRtmp(uint8_t ui8Type, uint32_t ui32StreamId,
|
|||||||
set_le32(header.streamId, ui32StreamId);
|
set_le32(header.streamId, ui32StreamId);
|
||||||
|
|
||||||
//估算rtmp包数据大小
|
//估算rtmp包数据大小
|
||||||
uint32_t capacity = ((bExtStamp ? 5 : 1) * ((strBuf.size() / m_iChunkLenOut))) + strBuf.size() + sizeof(header) + 32;
|
uint32_t capacity = ((bExtStamp ? 5 : 1) * (1 + (strBuf.size() / m_iChunkLenOut))) + strBuf.size() + sizeof(header);
|
||||||
uint32_t totalSize = 0;
|
uint32_t totalSize = 0;
|
||||||
Socket::BufferRaw::Ptr buffer = m_bufferPool.obtain();
|
Socket::BufferRaw::Ptr buffer = m_bufferPool.obtain();
|
||||||
buffer->setCapacity(capacity);
|
buffer->setCapacity(capacity);
|
||||||
|
Loading…
Reference in New Issue
Block a user