From 9a53529754c5ce91284aad960928ddfa07ac2e8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Mon, 20 Jun 2016 16:30:40 +0300 Subject: main/rtmpdump: improve performance by adjusting outbound chunk size change outbound chunk size to server's chunk size. this improves performance significantly. (cherry picked from commit bf39fb1177ee77eee6c214a7393cc0054958ce08) --- main/rtmpdump/APKBUILD | 29 ++++++++++++----------------- main/rtmpdump/fix-chunk-size.patch | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 17 deletions(-) create mode 100644 main/rtmpdump/fix-chunk-size.patch diff --git a/main/rtmpdump/APKBUILD b/main/rtmpdump/APKBUILD index a638c9984d..5a234be32a 100644 --- a/main/rtmpdump/APKBUILD +++ b/main/rtmpdump/APKBUILD @@ -3,7 +3,7 @@ pkgname=rtmpdump verbase=2.4 pkgver=2.4_git20141231 -pkgrel=1 +pkgrel=2 pkgdesc="A tool to download rtmp:// and rtmpe:// streams" url="http://rtmpdump.mplayerhq.hu/" arch="all" @@ -15,26 +15,18 @@ subpackages="$pkgname-dev $pkgname-doc librtmp" giturl="git://git.ffmpeg.org/rtmpdump" disturl="dev.alpinelinux.org:/archive/rtmpdump" -source="http://dev.alpinelinux.org/archive/rtmpdump/rtmpdump-${pkgver}.tar.gz" +source="http://dev.alpinelinux.org/archive/rtmpdump/rtmpdump-${pkgver}.tar.gz + fix-chunk-size.patch" -_builddir="$srcdir"/$pkgname-$pkgver - -prepare() { - cd "$_builddir" - for i in $source; do - case $i in - *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; - esac - done -} +builddir="$srcdir"/$pkgname-$pkgver build() { - cd "$_builddir" + cd "$builddir" make || return 1 } package() { - cd "$_builddir" + cd "$builddir" make -j1 prefix=/usr MANDIR="$pkgdir/usr/share/man" DESTDIR="$pkgdir" install } @@ -46,6 +38,9 @@ librtmp() { mv "$pkgdir"/usr/lib "$subpkgdir"/usr/ } -md5sums="03c4c1fdfff2fc16f89c88097c2a132a rtmpdump-2.4_git20141231.tar.gz" -sha256sums="f2c7309a9c58c9da9c310c830c9fcb09f6ed999b074c585b4c127ad9ecba1b39 rtmpdump-2.4_git20141231.tar.gz" -sha512sums="3029e7e6079b8ae444c60dee3dcabf637570a51d26d5ca546603fa1cf4e3f2c9f2a8e721a14e5710b13bd746ba73004f2ce3d46b3388b52cf5775b522d8b1eb6 rtmpdump-2.4_git20141231.tar.gz" +md5sums="03c4c1fdfff2fc16f89c88097c2a132a rtmpdump-2.4_git20141231.tar.gz +d7111fb8afe34ca52a5697bd91b641d9 fix-chunk-size.patch" +sha256sums="f2c7309a9c58c9da9c310c830c9fcb09f6ed999b074c585b4c127ad9ecba1b39 rtmpdump-2.4_git20141231.tar.gz +dbb2dc7f99bfb38c8440d60e11c03986470fef6d73d64767f9414d95812ab38c fix-chunk-size.patch" +sha512sums="3029e7e6079b8ae444c60dee3dcabf637570a51d26d5ca546603fa1cf4e3f2c9f2a8e721a14e5710b13bd746ba73004f2ce3d46b3388b52cf5775b522d8b1eb6 rtmpdump-2.4_git20141231.tar.gz +ddc7d2a67648284eaace4304864c8aabd14b4e2b90124915058b83c6a27a1feeb77fb2c76f77168975631982dc0c6c0eeafdd6a767cd3b1e8b5d771ade072a3c fix-chunk-size.patch" 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; ++ } + } + } + -- cgit v1.2.3