From 3d3b4d2af52b54cdb24f2f7e7fcd8497cf75056c Mon Sep 17 00:00:00 2001 From: saxon Date: Thu, 5 Jul 2018 10:16:30 +0930 Subject: [PATCH] Getting ready for a test run --- rtmp/rtmp.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 }