diff --git a/rtmp/rtmp.go b/rtmp/rtmp.go index c2149548..53ed5491 100644 --- a/rtmp/rtmp.go +++ b/rtmp/rtmp.go @@ -1496,8 +1496,9 @@ func rtmpSendPacket(r *C.RTMP, packet *C.RTMPPacket, queue int) int { //txn = int(C.AMF_DecodeNumber((*C.char)(ptr))) txn = int(amfDecodeNumber((*byte)(ptr))) // TODO: port this - C.AV_queue(&r.m_methodCalls, (*C.int)(unsafe.Pointer(&r.m_numCalls)), &method, - C.int(txn)) + avQueue(&r.m_methodCalls, (*int)(unsafe.Pointer(&r.m_numCalls)), &method, txn) + //C.AV_queue(&r.m_methodCalls, (*C.int)(unsafe.Pointer(&r.m_numCalls)), &method, + //C.int(txn)) } } @@ -1570,8 +1571,8 @@ func avQueue(vals **C.RTMP_METHOD, num *int, av *C.AVal, txn int) { *vals = (*C.RTMP_METHOD)(C.realloc(unsafe.Pointer(*vals), C.size_t((*num+16)*int( unsafe.Sizeof(*(*vals)))))) } - //tmp := C.malloc(C.size_t(av.av_len + 1)) - tmp := allocate(uintptr(av.av_len + 1)) + tmp := C.malloc(C.size_t(av.av_len + 1)) + //tmp := allocate(uintptr(av.av_len + 1)) memmove(tmp, unsafe.Pointer(av.av_val), uintptr(av.av_len)) *indxBytePtr(tmp, int(av.av_len)) = '\000'