mirror of https://bitbucket.org/ausocean/av.git
rtmp: make C_RTMPChunk.c_chunk a []byte
This commit is contained in:
parent
f387b827ae
commit
86e07e2b32
|
@ -1422,11 +1422,8 @@ func C_RTMP_ReadPacket(r *C_RTMP, packet *C_RTMPPacket) (ok bool) {
|
||||||
|
|
||||||
if packet.m_chunk != nil {
|
if packet.m_chunk != nil {
|
||||||
packet.m_chunk.c_headerSize = hSize
|
packet.m_chunk.c_headerSize = hSize
|
||||||
memmove(unsafe.Pointer(&packet.m_chunk.c_header[0]), unsafe.Pointer(&hbuf[0]),
|
copy(packet.m_chunk.c_header[:], hbuf[:hSize])
|
||||||
uintptr(hSize))
|
packet.m_chunk.c_chunk = (*[_Gi]byte)(unsafe.Pointer(packet.m_body))[packet.m_nBytesRead : packet.m_nBytesRead+uint32(nChunk)]
|
||||||
packet.m_chunk.c_chunk = (*byte)(incBytePtr(unsafe.Pointer(packet.m_body),
|
|
||||||
int(packet.m_nBytesRead)))
|
|
||||||
packet.m_chunk.c_chunkSize = nChunk
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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))),
|
||||||
|
|
|
@ -114,8 +114,7 @@ const (
|
||||||
// rtmp.h +105
|
// rtmp.h +105
|
||||||
type C_RTMPChunk struct {
|
type C_RTMPChunk struct {
|
||||||
c_headerSize int32
|
c_headerSize int32
|
||||||
c_chunkSize int32
|
c_chunk []byte
|
||||||
c_chunk *byte
|
|
||||||
c_header [RTMP_MAX_HEADER_SIZE]byte
|
c_header [RTMP_MAX_HEADER_SIZE]byte
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue