diff --git a/rtmp/rtmp.go b/rtmp/rtmp.go index c5534eb9..2a992eab 100644 --- a/rtmp/rtmp.go +++ b/rtmp/rtmp.go @@ -110,11 +110,11 @@ func (s *session) Write(data []byte) (int, error) { if s.rtmp == nil { return 0, Err(3) } - if C.RTMP_IsConnected(s.rtmp) <= 0 { + if C.RTMP_IsConnected(s.rtmp) == 0 { return 0, Err(1) } - if C.RTMP_Write(s.rtmp,(*C.char)(unsafe.Pointer(&data[0])),C.int(len(data))) <= 0 { - //if rtmpWrite(s.rtmp, data) <= 0 { + //if C.RTMP_Write(s.rtmp,(*C.char)(unsafe.Pointer(&data[0])),C.int(len(data))) == 0 { + if rtmpWrite(s.rtmp, data) == 0 { return 0, Err(2) } return len(data), nil