From 7ddd2ac6d1107c132e3f0783bc49600baaeae4ca Mon Sep 17 00:00:00 2001 From: saxon Date: Sat, 28 Jul 2018 16:44:27 +0930 Subject: [PATCH] Using our amfEncodeInt32 - tested and working --- rtmp/rtmp.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rtmp/rtmp.go b/rtmp/rtmp.go index 5c0077ce..438c6284 100644 --- a/rtmp/rtmp.go +++ b/rtmp/rtmp.go @@ -877,6 +877,7 @@ func rtmpSockBufFill(sb *C.RTMPSockBuf) int { int(uintptr(unsafe.Pointer(sb.sb_start))-uintptr(unsafe.Pointer( &sb.sb_buf[0]))) + // TODO: figure out what to do with recv nBytes = int(C.recv(sb.sb_socket, unsafe.Pointer(uintptr(unsafe.Pointer( sb.sb_start))+uintptr(int(sb.sb_size))), C.size_t(nBytes), 0)) @@ -906,7 +907,8 @@ func sendBytesReceived(r *C.RTMP) int { packet.m_nBodySize = 4 - C.AMF_EncodeInt32(packet.m_body, (*C.char)(unsafe.Pointer(pend)), r.m_nBytesIn) + amfEncodeInt32((*byte)(unsafe.Pointer(packet.m_body)), pend, int32(r.m_nBytesIn)) + // C.AMF_EncodeInt32(packet.m_body, (*C.char)(unsafe.Pointer(pend)), r.m_nBytesIn) r.m_nBytesInSent = r.m_nBytesIn