diff --git a/rtmp/rtmp.go b/rtmp/rtmp.go index 4064d512..73dac206 100644 --- a/rtmp/rtmp.go +++ b/rtmp/rtmp.go @@ -647,7 +647,7 @@ func C_WriteN(r *C_RTMP, buffer unsafe.Pointer, n int) (ok bool) { for n > 0 { var nBytes int - nBytes = int(C_RTMPSockBuf_Send(&r.m_sb, (*byte)(ptr), int32(n))) + nBytes = int(C_RTMPSockBuf_Send(&r.m_sb, pl2b((*byte)(ptr), n))) if nBytes < 0 { if debugMode { @@ -1817,8 +1817,8 @@ func C_RTMPSockBuf_Fill(sb *C_RTMPSockBuf) int { // int RTMPSockBuf_Send(RTMPSockBuf* sb, const char* buf, int len); // rtmp.c +4297 // TODO replace send with golang net connection send -func C_RTMPSockBuf_Send(sb *C_RTMPSockBuf, buf *byte, l int32) int32 { - return int32(C.send(C.int(sb.sb_socket), unsafe.Pointer(buf), C.size_t(l), 0)) +func C_RTMPSockBuf_Send(sb *C_RTMPSockBuf, buf []byte) int32 { + return int32(C.send(C.int(sb.sb_socket), unsafe.Pointer(bAddr(buf)), C.ulong(len(buf)), 0)) } // int