Commented out rtmp close and rtmp frees - tested and working

This commit is contained in:
saxon 2018-07-28 15:24:36 +09:30
parent 3a56d47244
commit b20a344eb1
1 changed files with 6 additions and 6 deletions

View File

@ -400,8 +400,8 @@ func startSession(rtmp *C.RTMP, u string, timeout uint32) (*C.RTMP, error) {
rtmp.Link.timeout = connect_timeout
if rtmpSetupUrl(rtmp, u) == 0 {
// if C.RTMP_SetupURL(rtmp, C.CString(u)) == 0 {
C.RTMP_Close(rtmp)
C.RTMP_Free(rtmp)
//C.RTMP_Close(rtmp)
//C.RTMP_Free(rtmp)
return nil, errors.New("rtmp startSession: Failed to setup URL!")
}
@ -411,16 +411,16 @@ func startSession(rtmp *C.RTMP, u string, timeout uint32) (*C.RTMP, error) {
C.RTMP_SetBufferMS(rtmp, 3600*1000)
// if rtmpConnect(rtmp, nil) == 0 {
if C.RTMP_Connect(rtmp, nil) == 0 {
C.RTMP_Close(rtmp)
C.RTMP_Free(rtmp)
//C.RTMP_Close(rtmp)
//C.RTMP_Free(rtmp)
return nil, errors.New("rtmp startSession: Failed to connect!")
}
// TODO: port this
// if rtmpConnectStream(rtmp, 0) == 0 {
if C.RTMP_ConnectStream(rtmp, 0) == 0 {
C.RTMP_Close(rtmp)
C.RTMP_Free(rtmp)
//C.RTMP_Close(rtmp)
//C.RTMP_Free(rtmp)
return nil, errors.New("rtmp startSession: Failed to connect stream!")
}