diff --git a/rtmp/socket.go b/rtmp/socket.go index 31542ab8..e8ab1e02 100644 --- a/rtmp/socket.go +++ b/rtmp/socket.go @@ -189,7 +189,7 @@ func C_RTMPSockBuf_Fill(sb *C_RTMPSockBuf) int { sb.sb_start = 0 } - nBytes := C.long((len(sb.sb_buf) - 1) - (sb.sb_size + sb.sb_start)) + nBytes := C.ssize_t((len(sb.sb_buf) - 1) - (sb.sb_size + sb.sb_start)) nBytes, err := C.recv(C.int(sb.sb_socket), unsafe.Pointer(&sb.sb_buf[sb.sb_start+sb.sb_size]), C.size_t(nBytes), 0) if nBytes == -1 { log.Printf("C_RTMPSockBuf_Fill: recv error: %v", err) @@ -208,7 +208,7 @@ func C_RTMPSockBuf_Fill(sb *C_RTMPSockBuf) int { // rtmp.c +4297 // TODO replace send with golang net connection send 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)) + return int32(C.send(C.int(sb.sb_socket), unsafe.Pointer(bAddr(buf)), C.size_t(len(buf)), 0)) } // int