mirror of https://bitbucket.org/ausocean/av.git
changed name of writeN to C_WriteN
This commit is contained in:
parent
d2fa240c1c
commit
5ffd3ddee6
14
rtmp/rtmp.go
14
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
|
||||
|
|
Loading…
Reference in New Issue