From 1f6a59b050fc78ea51a5a20071b3a2d05696ac14 Mon Sep 17 00:00:00 2001 From: saxon Date: Sun, 29 Jul 2018 10:26:05 +0930 Subject: [PATCH] Using all my encoding functions in sendConnectPacket - tested and working --- rtmp/rtmp.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/rtmp/rtmp.go b/rtmp/rtmp.go index 4aa8e9ef..717e758f 100644 --- a/rtmp/rtmp.go +++ b/rtmp/rtmp.go @@ -1045,9 +1045,9 @@ func sendConnectPacket(r *C.RTMP, cp *C.RTMPPacket) int { return 0 } if r.Link.pageUrl.av_len != 0 { - enc = (*byte)(unsafe.Pointer(C.AMF_EncodeNamedString((*C.char)( - unsafe.Pointer(enc)), (*C.char)(unsafe.Pointer(pend)), &av_pageUrl, &r.Link.pageUrl))) - //enc = amfEncodeNamedString(enc, pend, &av_pageUrl, &r.Link.pageUrl) + //enc = (*byte)(unsafe.Pointer(C.AMF_EncodeNamedString((*C.char)( + //unsafe.Pointer(enc)), (*C.char)(unsafe.Pointer(pend)), &av_pageUrl, &r.Link.pageUrl))) + enc = amfEncodeNamedString(enc, pend, &av_pageUrl, &r.Link.pageUrl) if enc == nil { return 0 } @@ -1055,9 +1055,9 @@ func sendConnectPacket(r *C.RTMP, cp *C.RTMPPacket) int { } if r.m_fEncoding != 0.0 || r.m_bSendEncoding != 0 { - enc = (*byte)(unsafe.Pointer(C.AMF_EncodeNamedNumber((*C.char)( - unsafe.Pointer(enc)), (*C.char)(unsafe.Pointer(pend)), &av_objectEncoding, r.m_fEncoding))) - //enc = amfEncodeNamedNumber(enc, pend, &av_objectEncoding, float64(r.m_fEncoding)) + //enc = (*byte)(unsafe.Pointer(C.AMF_EncodeNamedNumber((*C.char)( + //unsafe.Pointer(enc)), (*C.char)(unsafe.Pointer(pend)), &av_objectEncoding, r.m_fEncoding))) + enc = amfEncodeNamedNumber(enc, pend, &av_objectEncoding, float64(r.m_fEncoding)) if enc == nil { return 0 } @@ -1077,9 +1077,9 @@ func sendConnectPacket(r *C.RTMP, cp *C.RTMPPacket) int { /* add auth string */ if r.Link.auth.av_len != 0 { - enc = (*byte)(unsafe.Pointer(C.AMF_EncodeBoolean((*C.char)( - unsafe.Pointer(enc)), (*C.char)(unsafe.Pointer(pend)), r.Link.lFlags&RTMP_LF_AUTH))) - //enc = amfEncodeBoolean(enc, pend, int(r.Link.lFlags&RTMP_LF_AUTH)) + //enc = (*byte)(unsafe.Pointer(C.AMF_EncodeBoolean((*C.char)( + // unsafe.Pointer(enc)), (*C.char)(unsafe.Pointer(pend)), r.Link.lFlags&RTMP_LF_AUTH))) + enc = amfEncodeBoolean(enc, pend, int(r.Link.lFlags&RTMP_LF_AUTH)) if enc == nil { return 0 }