From 357bf4c87b6473ed1eeaf8c09d2f57535755e1e9 Mon Sep 17 00:00:00 2001 From: saxon Date: Sat, 28 Jul 2018 21:44:05 +0930 Subject: [PATCH] Using my realloc - tested and working --- rtmp/rtmp.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rtmp/rtmp.go b/rtmp/rtmp.go index 90446364..1b6587dc 100644 --- a/rtmp/rtmp.go +++ b/rtmp/rtmp.go @@ -1270,10 +1270,10 @@ func rtmpSendPacket(r *C.RTMP, packet *C.RTMPPacket, queue int) int { if packet.m_nChannel >= r.m_channelsAllocatedOut { n := int(packet.m_nChannel + 10) - packets = C.realloc(unsafe.Pointer(r.m_vecChannelsOut), C.size_t( - unsafe.Sizeof(packet)*uintptr(n))) - //packets = realloc(unsafe.Pointer(r.m_vecChannelsOut), - //int(unsafe.Sizeof(packet)*uintptr(n))) + //packets = C.realloc(unsafe.Pointer(r.m_vecChannelsOut), C.size_t( + //unsafe.Sizeof(packet)*uintptr(n))) + packets = realloc(unsafe.Pointer(r.m_vecChannelsOut), + int(unsafe.Sizeof(packet)*uintptr(n))) if uintptr(packets) == uintptr(0) { //C.free(unsafe.Pointer(r.m_vecChannelsOut))