diff --git a/rtmp/rtmp.go b/rtmp/rtmp.go index d5984ed9..ae8c2ec6 100644 --- a/rtmp/rtmp.go +++ b/rtmp/rtmp.go @@ -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