From 084f7ce52ba0c35fb6001ba297cf7460b0e60bf2 Mon Sep 17 00:00:00 2001 From: saxon Date: Sun, 29 Jul 2018 10:36:55 +0930 Subject: [PATCH] Using my amfDecodeString but need to fix amfDecodeInt16 - tested and working --- rtmp/rtmp.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rtmp/rtmp.go b/rtmp/rtmp.go index 2c6a25eb..08587565 100644 --- a/rtmp/rtmp.go +++ b/rtmp/rtmp.go @@ -1391,6 +1391,7 @@ func rtmpSendPacket(r *C.RTMP, packet *C.RTMPPacket, queue int) int { } if nSize > 8 { + // TODO: port this hptr = incBytePtr(hptr, int(C.EncodeInt32LE((*C.char)(hptr), C.int(packet.m_nInfoField2)))) } @@ -1482,8 +1483,8 @@ func rtmpSendPacket(r *C.RTMP, packet *C.RTMPPacket, queue int) int { var method C.AVal var ptr unsafe.Pointer ptr = incBytePtr(unsafe.Pointer(packet.m_body), 1) - C.AMF_DecodeString((*C.char)(ptr), &method) - //amfDecodeString((*byte)(ptr), &method) + //C.AMF_DecodeString((*C.char)(ptr), &method) + amfDecodeString((*byte)(ptr), &method) if debugMode { log.Printf("Invoking %v", method.av_val) @@ -1660,7 +1661,8 @@ func amfEncodeNamedString(output *byte, outend *byte, strName *C.AVal, strValue // amfDecodeString decodes data into a string inside a AVal func amfDecodeString(data *byte, bv *C.AVal) { dataPtr := unsafe.Pointer(data) - bv.av_len = C.int(amfDecodeInt16((*byte)(dataPtr))) + bv.av_len = C.int(C.AMF_DecodeInt16((*C.char)(dataPtr))) + //bv.av_len = C.int(amfDecodeInt16((*byte)(dataPtr))) if bv.av_len > 0 { bv.av_val = (*C.char)(incBytePtr(dataPtr, 2)) } else {