From 7b69015873397b77bb12b8ed65c45f229a59e4bf Mon Sep 17 00:00:00 2001
From: Dan Kortschak <dan@kortschak.io>
Date: Wed, 19 Sep 2018 11:11:15 +0930
Subject: [PATCH] rtmp: make C_RTMPSockBuf_Send take a []byte

---
 rtmp/rtmp.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/rtmp/rtmp.go b/rtmp/rtmp.go
index 4064d512..73dac206 100644
--- a/rtmp/rtmp.go
+++ b/rtmp/rtmp.go
@@ -647,7 +647,7 @@ func C_WriteN(r *C_RTMP, buffer unsafe.Pointer, n int) (ok bool) {
 	for n > 0 {
 		var nBytes int
 
-		nBytes = int(C_RTMPSockBuf_Send(&r.m_sb, (*byte)(ptr), int32(n)))
+		nBytes = int(C_RTMPSockBuf_Send(&r.m_sb, pl2b((*byte)(ptr), n)))
 
 		if nBytes < 0 {
 			if debugMode {
@@ -1817,8 +1817,8 @@ func C_RTMPSockBuf_Fill(sb *C_RTMPSockBuf) int {
 // int RTMPSockBuf_Send(RTMPSockBuf* sb, const char* buf, int len);
 // rtmp.c +4297
 // TODO replace send with golang net connection send
-func C_RTMPSockBuf_Send(sb *C_RTMPSockBuf, buf *byte, l int32) int32 {
-	return int32(C.send(C.int(sb.sb_socket), unsafe.Pointer(buf), C.size_t(l), 0))
+func C_RTMPSockBuf_Send(sb *C_RTMPSockBuf, buf []byte) int32 {
+	return int32(C.send(C.int(sb.sb_socket), unsafe.Pointer(bAddr(buf)), C.ulong(len(buf)), 0))
 }
 
 // int