mirror of https://bitbucket.org/ausocean/av.git
Changed name of rtmpReadPacket to C_RTMP_ReadPacket
This commit is contained in:
parent
49a54bccf8
commit
4a3ff1f4b9
12
rtmp/rtmp.go
12
rtmp/rtmp.go
|
@ -1289,7 +1289,7 @@ func C_RTMP_ConnectStream(r *C.RTMP, seekTime int32) int {
|
||||||
return int(r.m_bPlaying)
|
return int(r.m_bPlaying)
|
||||||
}
|
}
|
||||||
|
|
||||||
func rtmpReadPacket(r *C.RTMP, packet *C.RTMPPacket) int32 {
|
func C_RTMP_ReadPacket(r *C.RTMP, packet *C.RTMPPacket) int32 {
|
||||||
var hbuf [RTMP_MAX_HEADER_SIZE]uint8
|
var hbuf [RTMP_MAX_HEADER_SIZE]uint8
|
||||||
memset((*byte)(&hbuf[0]), 0, RTMP_MAX_HEADER_SIZE)
|
memset((*byte)(&hbuf[0]), 0, RTMP_MAX_HEADER_SIZE)
|
||||||
var header *byte
|
var header *byte
|
||||||
|
@ -1299,7 +1299,7 @@ func rtmpReadPacket(r *C.RTMP, packet *C.RTMPPacket) int32 {
|
||||||
var extendedTimestamp int32
|
var extendedTimestamp int32
|
||||||
|
|
||||||
if C_ReadN(r, (*byte)(&hbuf[0]), 1) == 0 {
|
if C_ReadN(r, (*byte)(&hbuf[0]), 1) == 0 {
|
||||||
log.Println("rtmpReadPacket: failed to read RTMP packet header!")
|
log.Println("C_RTMP_ReadPacket: failed to read RTMP packet header!")
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1310,7 +1310,7 @@ func rtmpReadPacket(r *C.RTMP, packet *C.RTMPPacket) int32 {
|
||||||
switch {
|
switch {
|
||||||
case packet.m_nChannel == 0:
|
case packet.m_nChannel == 0:
|
||||||
if C_ReadN(r, (*byte)(&hbuf[1]), 1) != 1 {
|
if C_ReadN(r, (*byte)(&hbuf[1]), 1) != 1 {
|
||||||
log.Println("rtmpReadPacket: failed to read rtmp packet header 2nd byte.")
|
log.Println("C_RTMP_ReadPacket: failed to read rtmp packet header 2nd byte.")
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1321,7 +1321,7 @@ func rtmpReadPacket(r *C.RTMP, packet *C.RTMPPacket) int32 {
|
||||||
var tmp int32
|
var tmp int32
|
||||||
|
|
||||||
if C_ReadN(r, (*byte)(&hbuf[1]), 2) != 2 {
|
if C_ReadN(r, (*byte)(&hbuf[1]), 2) != 2 {
|
||||||
log.Println("rtmpReadPacket: failed to read RTMP packet 3rd byte")
|
log.Println("C_RTMP_ReadPacket: failed to read RTMP packet 3rd byte")
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1382,7 +1382,7 @@ func rtmpReadPacket(r *C.RTMP, packet *C.RTMPPacket) int32 {
|
||||||
nSize--
|
nSize--
|
||||||
|
|
||||||
if nSize > 0 && C_ReadN(r, header, int(nSize)) != int(nSize) {
|
if nSize > 0 && C_ReadN(r, header, int(nSize)) != int(nSize) {
|
||||||
log.Println("rtmpReadPacket: failed to read rtmp packet header.")
|
log.Println("C_RTMP_ReadPacket: failed to read rtmp packet header.")
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1452,7 +1452,7 @@ func rtmpReadPacket(r *C.RTMP, packet *C.RTMPPacket) int32 {
|
||||||
|
|
||||||
if C_ReadN(r, (*byte)(incBytePtr(unsafe.Pointer(packet.m_body), int(packet.m_nBytesRead))),
|
if C_ReadN(r, (*byte)(incBytePtr(unsafe.Pointer(packet.m_body), int(packet.m_nBytesRead))),
|
||||||
int(nChunk)) != int(nChunk) {
|
int(nChunk)) != int(nChunk) {
|
||||||
log.Println("rtmpReadPacket: failed to read RTMP packet body")
|
log.Println("C_RTMP_ReadPacket: failed to read RTMP packet body")
|
||||||
return FALSE
|
return FALSE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue