diff --git a/rtmp/rtmp.go b/rtmp/rtmp.go index f5053fe9..4c8c3f67 100644 --- a/rtmp/rtmp.go +++ b/rtmp/rtmp.go @@ -959,9 +959,9 @@ func sendConnectPacket(r *C.RTMP, cp *C.RTMPPacket) int { enc = (*byte)(unsafe.Pointer(packet.m_body)) - enc = (*byte)(unsafe.Pointer(C.AMF_EncodeString((*C.char)(unsafe.Pointer(enc)), - (*C.char)(unsafe.Pointer(pend)), &av_connect))) - //enc = amfEncodeString(enc, pend, &av_connect) + //enc = (*byte)(unsafe.Pointer(C.AMF_EncodeString((*C.char)(unsafe.Pointer(enc)), + //(*C.char)(unsafe.Pointer(pend)), &av_connect))) + enc = amfEncodeString(enc, pend, &av_connect) r.m_numInvokes += 1 enc = (*byte)(unsafe.Pointer(C.AMF_EncodeNumber((*C.char)(unsafe.Pointer(enc)), (*C.char)(unsafe.Pointer(pend)), C.double(r.m_numInvokes)))) @@ -1714,14 +1714,14 @@ func amfEncodeString(output *byte, outend *byte, bv *C.AVal) *byte { } if bv.av_len < 65536 { *(*byte)(outputPtr) = AMF_STRING - incBytePtr(outputPtr, 1) + outputPtr = incBytePtr(outputPtr, 1) outputPtr = unsafe.Pointer(C.AMF_EncodeInt16((*C.char)(outputPtr), (*C.char)( outendPtr), C.short(bv.av_len))) //outputPtr = unsafe.Pointer(amfEncodeInt16((*byte)(outputPtr), //(*byte)(outendPtr), (int16)(bv.av_len))) } else { *(*byte)(outputPtr) = AMF_LONG_STRING - incBytePtr(outputPtr, 1) + outputPtr = incBytePtr(outputPtr, 1) outputPtr = unsafe.Pointer(C.AMF_EncodeInt32((*C.char)(outputPtr), (*C.char)( outendPtr), C.int(bv.av_len))) //outputPtr = unsafe.Pointer(amfEncodeInt32((*byte)(outputPtr),