mirror of https://bitbucket.org/ausocean/av.git
rtmp: make C_RTMPSockBuf_Send take a []byte
This commit is contained in:
parent
bb6ee2a3ce
commit
7b69015873
|
@ -647,7 +647,7 @@ func C_WriteN(r *C_RTMP, buffer unsafe.Pointer, n int) (ok bool) {
|
||||||
for n > 0 {
|
for n > 0 {
|
||||||
var nBytes int
|
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 nBytes < 0 {
|
||||||
if debugMode {
|
if debugMode {
|
||||||
|
@ -1817,8 +1817,8 @@ func C_RTMPSockBuf_Fill(sb *C_RTMPSockBuf) int {
|
||||||
// int RTMPSockBuf_Send(RTMPSockBuf* sb, const char* buf, int len);
|
// int RTMPSockBuf_Send(RTMPSockBuf* sb, const char* buf, int len);
|
||||||
// rtmp.c +4297
|
// rtmp.c +4297
|
||||||
// TODO replace send with golang net connection send
|
// TODO replace send with golang net connection send
|
||||||
func C_RTMPSockBuf_Send(sb *C_RTMPSockBuf, buf *byte, l int32) int32 {
|
func C_RTMPSockBuf_Send(sb *C_RTMPSockBuf, buf []byte) int32 {
|
||||||
return int32(C.send(C.int(sb.sb_socket), unsafe.Pointer(buf), C.size_t(l), 0))
|
return int32(C.send(C.int(sb.sb_socket), unsafe.Pointer(bAddr(buf)), C.ulong(len(buf)), 0))
|
||||||
}
|
}
|
||||||
|
|
||||||
// int
|
// int
|
||||||
|
|
Loading…
Reference in New Issue