diff options
author | V3n3RiX <venerix@koprulu.sector> | 2022-05-12 16:42:50 +0300 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2022-05-12 16:42:50 +0300 |
commit | 752d6256e5204b958b0ef7905675a940b5e9172f (patch) | |
tree | 330d16e6362a49cbed8875a777fe641a43376cd3 /media-video/rtmpdump/files/rtmpdump-fix-chunk-size.patch | |
parent | 0c100b7dd2b30e75b799d806df4ef899fd98e1ea (diff) |
gentoo resync : 12.05.2022
Diffstat (limited to 'media-video/rtmpdump/files/rtmpdump-fix-chunk-size.patch')
-rw-r--r-- | media-video/rtmpdump/files/rtmpdump-fix-chunk-size.patch | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/media-video/rtmpdump/files/rtmpdump-fix-chunk-size.patch b/media-video/rtmpdump/files/rtmpdump-fix-chunk-size.patch new file mode 100644 index 000000000000..b714273273aa --- /dev/null +++ b/media-video/rtmpdump/files/rtmpdump-fix-chunk-size.patch @@ -0,0 +1,46 @@ +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 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) + { + 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__); ++ SendClientChunkSize(r, r->m_inChunkSize); ++ } + } + } + |