aboutsummaryrefslogtreecommitdiffstats
path: root/main/rtmpdump/fix-chunk-size.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/rtmpdump/fix-chunk-size.patch')
-rw-r--r--main/rtmpdump/fix-chunk-size.patch53
1 files changed, 33 insertions, 20 deletions
diff --git a/main/rtmpdump/fix-chunk-size.patch b/main/rtmpdump/fix-chunk-size.patch
index 1e138b8e40..b714273273 100644
--- a/main/rtmpdump/fix-chunk-size.patch
+++ b/main/rtmpdump/fix-chunk-size.patch
@@ -1,32 +1,45 @@
-diff -ru rtmpdump-2.4_git20141231.orig/librtmp/rtmp.c rtmpdump-2.4_git20141231/librtmp/rtmp.c
---- rtmpdump-2.4_git20141231.orig/librtmp/rtmp.c 2014-07-07 10:15:59.000000000 +0300
-+++ rtmpdump-2.4_git20141231/librtmp/rtmp.c 2016-06-19 21:31:48.898114687 +0300
-@@ -127,7 +127,7 @@
-
- static int HandleInvoke(RTMP *r, const char *body, unsigned int nBodySize);
- static int HandleMetadata(RTMP *r, char *body, unsigned int len);
--static void HandleChangeChunkSize(RTMP *r, const RTMPPacket *packet);
-+static void HandleChangeChunkSize(RTMP *r, RTMPPacket *packet);
- static void HandleAudio(RTMP *r, const RTMPPacket *packet);
- static void HandleVideo(RTMP *r, const RTMPPacket *packet);
- static void HandleCtrl(RTMP *r, const RTMPPacket *packet);
-@@ -3339,13 +3339,19 @@
+diff --git a/librtmp/rtmp.c b/librtmp/rtmp.c
+index a2863b0..ac1b3be 100644
+--- a/librtmp/rtmp.c
++++ b/librtmp/rtmp.c
+@@ -2077,6 +2077,29 @@ RTMP_SendClientBW(RTMP *r)
}
- static void
--HandleChangeChunkSize(RTMP *r, const RTMPPacket *packet)
-+HandleChangeChunkSize(RTMP *r, RTMPPacket *packet)
+ static int
++SendClientChunkSize(RTMP *r, int chunkSize)
++{
++ RTMPPacket packet;
++ char pbuf[256], *pend = pbuf + sizeof(pbuf);
++ int ret;
++
++ packet.m_nChannel = 0x02; /* control channel (invoke) */
++ packet.m_headerType = RTMP_PACKET_SIZE_LARGE;
++ packet.m_packetType = RTMP_PACKET_TYPE_CHUNK_SIZE;
++ packet.m_nTimeStamp = 0;
++ packet.m_nInfoField2 = 0;
++ packet.m_hasAbsTimestamp = 0;
++ packet.m_body = pbuf + RTMP_MAX_HEADER_SIZE;
++
++ packet.m_nBodySize = 4;
++
++ AMF_EncodeInt32(packet.m_body, pend, chunkSize);
++ ret = RTMP_SendPacket(r, &packet, FALSE);
++ r->m_outChunkSize = chunkSize;
++ return ret;
++}
++
++static int
+ SendBytesReceived(RTMP *r)
{
- if (packet->m_nBodySize >= 4)
- {
+ RTMPPacket packet;
+@@ -3349,6 +3372,11 @@ HandleChangeChunkSize(RTMP *r, const RTMPPacket *packet)
r->m_inChunkSize = AMF_DecodeInt32(packet->m_body);
RTMP_Log(RTMP_LOGDEBUG, "%s, received: chunk size change to %d", __FUNCTION__,
r->m_inChunkSize);
+ if (r->Link.protocol & RTMP_FEATURE_WRITE)
+ {
+ RTMP_Log(RTMP_LOGDEBUG, "%s, updating outChunkSize too", __FUNCTION__);
-+ RTMP_SendPacket(r, packet, FALSE);
-+ r->m_outChunkSize = r->m_inChunkSize;
++ SendClientChunkSize(r, r->m_inChunkSize);
+ }
}
}