mirror of https://bitbucket.org/ausocean/av.git
rtmp: make C_RTMPSockBuf.sb_timedout a bool
This commit is contained in:
parent
9b5d62a99a
commit
b9fcb2202f
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue