From 030b3f6fcae1bd3e9c4a9b44a94214d2693b9b99 Mon Sep 17 00:00:00 2001 From: saxon Date: Wed, 11 Jul 2018 14:54:35 +0930 Subject: [PATCH] Taking a break --- rtmp/rtmp.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/rtmp/rtmp.go b/rtmp/rtmp.go index fa9679bd..d6f02786 100644 --- a/rtmp/rtmp.go +++ b/rtmp/rtmp.go @@ -114,7 +114,6 @@ func cPtrInc(a *C.char, inc C.uint) *C.char { func (s *session) rtmpWrite(r *C.RTMP, buf []byte) int { var pkt *C.RTMPPacket = &r.m_write - var pend, enc []byte size := len(buf) s2 := size var ret, num int @@ -165,10 +164,8 @@ func (s *session) rtmpWrite(r *C.RTMP, buf []byte) int { return 0 } - // Note this is pointer arithmatic - enc = pkt.m_body - // pend = enc + pkt.m_nBodySize - pend = cPtrInc(enc,pkt.m_nBodySize) + enc := C.GoBytes(unsafe.Pointer(pkt.m_body),C.int(pkt.m_nBodySize)) + pend := enc[int(pkt.m_nBodySize):] if pkt.m_packetType == C.RTMP_PACKET_TYPE_INFO { enc = C.AMF_EncodeString(enc, pend, &av_setDataFrame )