From 5ffd3ddee6caa9cfc735944fb25f030ca7dca487 Mon Sep 17 00:00:00 2001 From: saxon Date: Tue, 7 Aug 2018 12:40:43 +0930 Subject: [PATCH] changed name of writeN to C_WriteN --- rtmp/rtmp.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/rtmp/rtmp.go b/rtmp/rtmp.go index 1ad96734..18334f36 100644 --- a/rtmp/rtmp.go +++ b/rtmp/rtmp.go @@ -52,7 +52,7 @@ RTMP* start_session(RTMP* rtmp, char* url, uint connect_timeout); int write_frame(RTMP* rtmp, char* data, uint data_length); int end_session(RTMP* rtmp); void AV_queue(RTMP_METHOD **vals, int *num, AVal *av, int txn); -int writeN(RTMP *r, const char *buffer, int n); +int C_WriteN(RTMP *r, const char *buffer, int n); int EncodeInt32LE(char *output, int nVal); int HTTP_Post(RTMP *r, RTMPTCmd cmd, const char *buf, int len); */ @@ -779,7 +779,7 @@ func C_HandShake(r *C.RTMP, FP9HandShake int32) int { *indxBytePtr(unsafe.Pointer(clientsig), i) = byte(rand.Intn(256)) } - if writeN(r, unsafe.Pointer(&clientbuf[0]), RTMP_SIG_SIZE+1) == 0 { + if C_WriteN(r, unsafe.Pointer(&clientbuf[0]), RTMP_SIG_SIZE+1) == 0 { return 0 } @@ -805,7 +805,7 @@ func C_HandShake(r *C.RTMP, FP9HandShake int32) int { suptime = inet.Ntohl(suptime) // 2nd part of handshake - if writeN(r, unsafe.Pointer(&serversig[0]), RTMP_SIG_SIZE) == 0 { + if C_WriteN(r, unsafe.Pointer(&serversig[0]), RTMP_SIG_SIZE) == 0 { return 0 } @@ -1773,7 +1773,7 @@ func C_RTMP_SendPacket(r *C.RTMP, packet *C.RTMPPacket, queue int) int { toff = incBytePtr(toff, nChunkSize+hSize) } else { // TODO: port this - wrote = int(writeN(r, header, nChunkSize+hSize)) + wrote = int(C_WriteN(r, header, nChunkSize+hSize)) if wrote == 0 { return 0 @@ -1817,7 +1817,7 @@ func C_RTMP_SendPacket(r *C.RTMP, packet *C.RTMPPacket, queue int) int { } if tbuf != nil { - wrote := int(writeN(r, tbuf, int(uintptr(decBytePtr(toff, + wrote := int(C_WriteN(r, tbuf, int(uintptr(decBytePtr(toff, int(uintptr(unsafe.Pointer(tbuf)))))))) //C.free(tbuf) tbuf = nil @@ -1867,7 +1867,7 @@ func C_RTMP_SendPacket(r *C.RTMP, packet *C.RTMPPacket, queue int) int { return 1 } -func writeN(r *C.RTMP, buffer unsafe.Pointer, n int) int { +func C_WriteN(r *C.RTMP, buffer unsafe.Pointer, n int) int { ptr := buffer for n > 0 { var nBytes int @@ -1877,7 +1877,7 @@ func writeN(r *C.RTMP, buffer unsafe.Pointer, n int) int { if nBytes < 0 { if debugMode { - log.Println("writeN, RTMP send error") + log.Println("C_WriteN, RTMP send error") } // TODO: port this