rtmp: fix C types for arm

This commit is contained in:
Dan Kortschak 2018-09-26 12:43:13 +09:30
parent e5faa396c1
commit 85b74d6624
1 changed files with 2 additions and 2 deletions

View File

@ -189,7 +189,7 @@ func C_RTMPSockBuf_Fill(sb *C_RTMPSockBuf) int {
sb.sb_start = 0 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) 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 { if nBytes == -1 {
log.Printf("C_RTMPSockBuf_Fill: recv error: %v", err) log.Printf("C_RTMPSockBuf_Fill: recv error: %v", err)
@ -208,7 +208,7 @@ func C_RTMPSockBuf_Fill(sb *C_RTMPSockBuf) int {
// rtmp.c +4297 // rtmp.c +4297
// TODO replace send with golang net connection send // TODO replace send with golang net connection send
func C_RTMPSockBuf_Send(sb *C_RTMPSockBuf, buf []byte) int32 { 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 // int