diff --git a/rtmp/rtmp.go b/rtmp/rtmp.go index fac20d1a..a7a41e59 100644 --- a/rtmp/rtmp.go +++ b/rtmp/rtmp.go @@ -86,6 +86,7 @@ func (s *session) Open() error { return nil } +/* func (s *session) rtmpWrite(rtmp *C.RTMP, data []byte) bool { var pkt *C.RTMPPacket = &rtmp.m_write var pend, enc *C.char @@ -94,15 +95,21 @@ func (s *session) rtmpWrite(rtmp *C.RTMP, data []byte) bool { } +*/ func (s *session) writeFrame(data []byte) uint { if !C.RTMP_IsConnected(rtmp) { return 1 } - // !C.RTMP_Write(s.rtmp, (const char*)(*C.char)(unsafe.Pointer(&data[0])), C.uint(dataLength)) + + if !C.RTMP_Write(s.rtmp, (const char*)(*C.char)(unsafe.Pointer(&data[0])), C.uint(dataLength)) { + return 2 + } + /* if rtmpWrite(s.rtmp, data) { return 2 } + */ return 0 }