Using indxptr func in all places

This commit is contained in:
saxon 2018-07-14 15:01:06 +09:30
parent a48d2fe008
commit 0898d50f0f
1 changed files with 3 additions and 3 deletions

View File

@ -148,13 +148,13 @@ func rtmpWrite(r *C.RTMP, data []byte) int {
log.Printf("too small \n")
return 0
}
if indxPtr(buf,0) == 'F' && indxPtr(buf,1) == 'L' && indxPtr(buf,2) == 'V' {
buf = unsafe.Pointer(uintptr(buf) + uintptr(13))
s2 -= 13
}
pkt.m_packetType = C.uchar(*(*byte)(buf))
pkt.m_packetType = C.uchar(indxPtr(buf,0))
buf = incPtr(buf, 1)
// TODO: port this
pkt.m_nBodySize = C.AMF_DecodeInt24((*C.char)(buf))
@ -162,7 +162,7 @@ func rtmpWrite(r *C.RTMP, data []byte) int {
// TODO: replace with ported version
pkt.m_nTimeStamp = C.AMF_DecodeInt24((*C.char)(buf))
buf = incPtr(buf, 3)
pkt.m_nTimeStamp |= C.uint(*((*byte)(buf))) << 24
pkt.m_nTimeStamp |= C.uint(indxPtr(buf,0)) << 24
buf = incPtr(buf, 4)
s2 -= 11