mirror of https://bitbucket.org/ausocean/av.git
Getting seg fault in avQueue
This commit is contained in:
parent
0fc985d1c5
commit
10667ba5f0
|
@ -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'
|
||||
|
||||
|
|
Loading…
Reference in New Issue