From 1ad73635e8dbabe486456c19cfe751e029fc0a8b Mon Sep 17 00:00:00 2001 From: hyc Date: Wed, 9 Dec 2009 04:03:10 +0000 Subject: [PATCH] Fix SendRTMP, just use default chunksize on writes git-svn-id: svn://svn.mplayerhq.hu/rtmpdump@59 400ebc74-4327-4243-bc38-086b20814532 --- rtmp.cpp | 7 +++---- rtmp.h | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/rtmp.cpp b/rtmp.cpp index 7b9170b..74fe24f 100644 --- a/rtmp.cpp +++ b/rtmp.cpp @@ -1829,13 +1829,12 @@ bool CRTMP::SendRTMP(RTMPPacket &packet) nSize = packet.m_nBodySize; char *buffer = packet.m_body; + int nChunkSize = nSize > RTMP_DEFAULT_CHUNKSIZE ? + RTMP_DEFAULT_CHUNKSIZE : nSize; while (nSize) { - int nChunkSize = packet.m_packetType == 0x14?m_chunkSize:packet.m_nBodySize; int wrote; - if (nSize < m_chunkSize) - nChunkSize = nSize; if (header) { wrote=WriteN(header, nChunkSize+hSize); @@ -1877,7 +1876,7 @@ void CRTMP::Close() m_stream_id = -1; m_socket = 0; - m_chunkSize = 128; + m_chunkSize = RTMP_DEFAULT_CHUNKSIZE; m_nBWCheckCounter = 0; m_nBytesIn = 0; m_nBytesInSent = 0; diff --git a/rtmp.h b/rtmp.h index ce8528f..50893eb 100644 --- a/rtmp.h +++ b/rtmp.h @@ -55,6 +55,8 @@ #define RTMP_PROTOCOL_RTMPTE 4 // not yet supported #define RTMP_PROTOCOL_RTMFP 5 // not yet supported +#define RTMP_DEFAULT_CHUNKSIZE 128 + extern char RTMPProtocolStringsLower[][7]; int32_t GetTime(); -- 2.40.0