From 4c4aa61da4489a9446a45578a86eea2e3a1cfb40 Mon Sep 17 00:00:00 2001 From: "771730766@qq.com" Date: Tue, 30 Jan 2018 13:52:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96rtmp=E5=86=85=E5=AD=98?= =?UTF-8?q?=E4=BC=B0=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtmp/RtmpProtocol.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Rtmp/RtmpProtocol.cpp b/src/Rtmp/RtmpProtocol.cpp index 23876fc8..9d26142e 100644 --- a/src/Rtmp/RtmpProtocol.cpp +++ b/src/Rtmp/RtmpProtocol.cpp @@ -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);