mirror of https://bitbucket.org/ausocean/av.git
Using indxptr func in all places
This commit is contained in:
parent
a48d2fe008
commit
0898d50f0f
|
@ -148,13 +148,13 @@ func rtmpWrite(r *C.RTMP, data []byte) int {
|
||||||
log.Printf("too small \n")
|
log.Printf("too small \n")
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
if indxPtr(buf,0) == 'F' && indxPtr(buf,1) == 'L' && indxPtr(buf,2) == 'V' {
|
if indxPtr(buf,0) == 'F' && indxPtr(buf,1) == 'L' && indxPtr(buf,2) == 'V' {
|
||||||
buf = unsafe.Pointer(uintptr(buf) + uintptr(13))
|
buf = unsafe.Pointer(uintptr(buf) + uintptr(13))
|
||||||
s2 -= 13
|
s2 -= 13
|
||||||
}
|
}
|
||||||
|
|
||||||
pkt.m_packetType = C.uchar(*(*byte)(buf))
|
pkt.m_packetType = C.uchar(indxPtr(buf,0))
|
||||||
buf = incPtr(buf, 1)
|
buf = incPtr(buf, 1)
|
||||||
// TODO: port this
|
// TODO: port this
|
||||||
pkt.m_nBodySize = C.AMF_DecodeInt24((*C.char)(buf))
|
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
|
// TODO: replace with ported version
|
||||||
pkt.m_nTimeStamp = C.AMF_DecodeInt24((*C.char)(buf))
|
pkt.m_nTimeStamp = C.AMF_DecodeInt24((*C.char)(buf))
|
||||||
buf = incPtr(buf, 3)
|
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)
|
buf = incPtr(buf, 4)
|
||||||
s2 -= 11
|
s2 -= 11
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue