From ba101285ffe920d771f19ee8e931fe4eabb1f45b Mon Sep 17 00:00:00 2001 From: saxon Date: Mon, 6 Aug 2018 15:42:16 +0930 Subject: [PATCH] Changed name of rtmpAlloc to C_RTMP_Alloc --- rtmp/rtmp.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/rtmp/rtmp.go b/rtmp/rtmp.go index aeaafe1e..2aa11e73 100644 --- a/rtmp/rtmp.go +++ b/rtmp/rtmp.go @@ -393,7 +393,7 @@ func (s *session) Write(data []byte) (int, error) { return 0, Err(3) } - // if rtmpIsConnected(s.rtmp) == 0 { + // if C_RTMP_IsConnected(s.rtmp) == 0 { if C.RTMP_IsConnected(s.rtmp) == 0 { return 0, Err(1) } @@ -414,7 +414,7 @@ func C_RTMP_IsConnected(r *C.RTMP) int32 { func startSession(rtmp *C.RTMP, u string, timeout uint32) (*C.RTMP, error) { connect_timeout := C.int(timeout) - rtmp = rtmpAlloc() + rtmp = C_RTMP_Alloc() //rtmp = C.RTMP_Alloc() rtmpInit(rtmp) //C.RTMP_Init(rtmp) @@ -447,8 +447,7 @@ func startSession(rtmp *C.RTMP, u string, timeout uint32) (*C.RTMP, error) { return rtmp, nil } - -func rtmpAlloc() *C.RTMP { +func C_RTMP_Alloc() *C.RTMP { var r C.RTMP //return (*C.RTMP)(C.malloc(C.size_t(unsafe.Sizeof(r)))) return (*C.RTMP)(allocate(unsafe.Sizeof(r))) @@ -571,7 +570,7 @@ func rtmpClose(r *C.RTMP) { func closeInternal(r *C.RTMP, reconnect int32) { var i int32 - if rtmpIsConnected(r) != 0 { + if C_RTMP_IsConnected(r) != 0 { if r.m_stream_id > 0 { i = int32(r.m_stream_id) if r.Link.protocol&RTMP_FEATURE_WRITE != 0 { @@ -1264,7 +1263,7 @@ func rtmpConnectStream(r *C.RTMP, seekTime int32) int { r.m_mediaChannel = 0 // TODO: read packet - for r.m_bPlaying == 0 && rtmpIsConnected(r) != 0 && + for r.m_bPlaying == 0 && C_RTMP_IsConnected(r) != 0 && C.RTMP_ReadPacket(r, &packet) != 0 { // TODO: port is ready