Finally working

This commit is contained in:
saxon 2018-07-13 20:30:52 +09:30
parent 21e80b483c
commit b0aa39c29b
1 changed files with 3 additions and 3 deletions

View File

@ -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