From b0aa39c29b69de9dfa77e93c07c15304ac7fe3d9 Mon Sep 17 00:00:00 2001 From: saxon Date: Fri, 13 Jul 2018 20:30:52 +0930 Subject: [PATCH] Finally working --- rtmp/rtmp.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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