From b9fcb2202fce34388f99a3e4d4f727c43125cb02 Mon Sep 17 00:00:00 2001 From: Dan Kortschak Date: Wed, 19 Sep 2018 10:42:04 +0930 Subject: [PATCH] rtmp: make C_RTMPSockBuf.sb_timedout a bool --- rtmp/rtmp.go | 8 ++++---- rtmp/rtmp_headers.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rtmp/rtmp.go b/rtmp/rtmp.go index ddf9dd04..c2d28c14 100644 --- a/rtmp/rtmp.go +++ b/rtmp/rtmp.go @@ -354,7 +354,7 @@ func C_add_addr_info(service *C.sockaddr_in, hostname string, port uint16) (ok b // rtmp.c +906 func C_RTMP_Connect0(r *C_RTMP, service *C.sockaddr) (ok bool) { on := 1 - r.m_sb.sb_timedout = 0 + r.m_sb.sb_timedout = false r.m_pausing = 0 r.m_fDuration = 0 @@ -590,7 +590,7 @@ func C_ReadN(r *C_RTMP, buffer *byte, n int) int { var avail int var ptr *byte - r.m_sb.sb_timedout = 0 + r.m_sb.sb_timedout = false ptr = buffer @@ -601,7 +601,7 @@ func C_ReadN(r *C_RTMP, buffer *byte, n int) int { avail = int(r.m_sb.sb_size) if avail == 0 { if C_RTMPSockBuf_Fill(&r.m_sb) < 1 { - if r.m_sb.sb_timedout == 0 { + if !r.m_sb.sb_timedout { return 0 } } @@ -1809,7 +1809,7 @@ func C_RTMPSockBuf_Fill(sb *C_RTMPSockBuf) int { if nBytes == -1 { log.Printf("C_RTMPSockBuf_Fill: recv error: %v", err) if err == syscall.EWOULDBLOCK || err == syscall.EAGAIN { - sb.sb_timedout = 1 + sb.sb_timedout = true nBytes = 0 } } else { diff --git a/rtmp/rtmp_headers.go b/rtmp/rtmp_headers.go index 69f634f6..afcd317b 100644 --- a/rtmp/rtmp_headers.go +++ b/rtmp/rtmp_headers.go @@ -140,7 +140,7 @@ type C_RTMPSockBuf struct { sb_size int32 sb_start *byte sb_buf [RTMP_BUFFER_CACHE_SIZE]byte // port const - sb_timedout int32 + sb_timedout bool } // RTMPPacket_IsReady(a)