Using my realloc - tested and working

This commit is contained in:
saxon 2018-07-28 21:44:05 +09:30
parent e059095c74
commit 357bf4c87b
1 changed files with 4 additions and 4 deletions

View File

@ -1270,10 +1270,10 @@ func rtmpSendPacket(r *C.RTMP, packet *C.RTMPPacket, queue int) int {
if packet.m_nChannel >= r.m_channelsAllocatedOut { if packet.m_nChannel >= r.m_channelsAllocatedOut {
n := int(packet.m_nChannel + 10) n := int(packet.m_nChannel + 10)
packets = C.realloc(unsafe.Pointer(r.m_vecChannelsOut), C.size_t( //packets = C.realloc(unsafe.Pointer(r.m_vecChannelsOut), C.size_t(
unsafe.Sizeof(packet)*uintptr(n))) //unsafe.Sizeof(packet)*uintptr(n)))
//packets = realloc(unsafe.Pointer(r.m_vecChannelsOut), packets = realloc(unsafe.Pointer(r.m_vecChannelsOut),
//int(unsafe.Sizeof(packet)*uintptr(n))) int(unsafe.Sizeof(packet)*uintptr(n)))
if uintptr(packets) == uintptr(0) { if uintptr(packets) == uintptr(0) {
//C.free(unsafe.Pointer(r.m_vecChannelsOut)) //C.free(unsafe.Pointer(r.m_vecChannelsOut))