aboutsummaryrefslogtreecommitdiffstats
path: root/main/rtmpdump/fix-chunk-size.patch
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2016-06-20 16:30:40 +0300
committerTimo Teräs <timo.teras@iki.fi>2016-06-20 16:30:40 +0300
commitbf39fb1177ee77eee6c214a7393cc0054958ce08 (patch)
treefbc622166020ed0f05e519af2f9c24c7fd5f79c3 /main/rtmpdump/fix-chunk-size.patch
parentb952ba78a85d98113d241eb0bc5bb7a13ebb117b (diff)
downloadaports-bf39fb1177ee77eee6c214a7393cc0054958ce08.tar.bz2
aports-bf39fb1177ee77eee6c214a7393cc0054958ce08.tar.xz
main/rtmpdump: improve performance by adjusting outbound chunk size
change outbound chunk size to server's chunk size. this improves performance significantly.
Diffstat (limited to 'main/rtmpdump/fix-chunk-size.patch')
-rw-r--r--main/rtmpdump/fix-chunk-size.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/main/rtmpdump/fix-chunk-size.patch b/main/rtmpdump/fix-chunk-size.patch
new file mode 100644
index 0000000000..1e138b8e40
--- /dev/null
+++ b/main/rtmpdump/fix-chunk-size.patch
@@ -0,0 +1,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;
++ }
+ }
+ }
+