[rtmpdump] r59 - rtmp.cpp rtmp.h

hyc subversion at mplayerhq.hu
Wed Dec 9 05:03:11 CET 2009


Author: hyc
Date: Wed Dec  9 05:03:10 2009
New Revision: 59

Log:
Fix SendRTMP, just use default chunksize on writes

Modified:
   rtmp.cpp
   rtmp.h

Modified: rtmp.cpp
==============================================================================
--- rtmp.cpp	Thu Dec  3 00:13:36 2009	(r58)
+++ rtmp.cpp	Wed Dec  9 05:03:10 2009	(r59)
@@ -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;

Modified: rtmp.h
==============================================================================
--- rtmp.h	Thu Dec  3 00:13:36 2009	(r58)
+++ rtmp.h	Wed Dec  9 05:03:10 2009	(r59)
@@ -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();


More information about the rtmpdump mailing list