aboutsummaryrefslogtreecommitdiffstats
path: root/main/rtmpdump/fix-chunk-size.patch
blob: 1e138b8e4061a76592b55cdc552f672646abd8a4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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 @@
 }
 
 static void
-HandleChangeChunkSize(RTMP *r, const RTMPPacket *packet)
+HandleChangeChunkSize(RTMP *r, RTMPPacket *packet)
 {
   if (packet->m_nBodySize >= 4)
     {
       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;
+        }
     }
 }