Commit 8f10cdba by 771730766@qq.com

优化rtmp内存估算

parent a97b7ce7
......@@ -202,7 +202,7 @@ void RtmpProtocol::sendRtmp(uint8_t ui8Type, uint32_t ui32StreamId,
set_le32(header.streamId, ui32StreamId);
//估算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;
Socket::BufferRaw::Ptr buffer = m_bufferPool.obtain();
buffer->setCapacity(capacity);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论