mirror of https://bitbucket.org/ausocean/av.git
rtmp: simplify body pointer setup
This commit is contained in:
parent
c31021149d
commit
b7c148fd93
21
rtmp/rtmp.go
21
rtmp/rtmp.go
|
@ -733,8 +733,7 @@ func C_SendConnectPacket(r *C_RTMP, cp *C_RTMPPacket) int {
|
|||
packet.m_nTimeStamp = 0
|
||||
packet.m_nInfoField2 = 0
|
||||
packet.m_hasAbsTimestamp = 0
|
||||
packet.m_body = (*byte)(incBytePtr(unsafe.Pointer(&pbuf[0]),
|
||||
RTMP_MAX_HEADER_SIZE))
|
||||
packet.m_body = &pbuf[RTMP_MAX_HEADER_SIZE]
|
||||
|
||||
enc = (*byte)(unsafe.Pointer(packet.m_body))
|
||||
|
||||
|
@ -871,8 +870,7 @@ func C_RTMP_SendCreateStream(r *C_RTMP) int32 {
|
|||
packet.m_nTimeStamp = 0
|
||||
packet.m_nInfoField2 = 0
|
||||
packet.m_hasAbsTimestamp = 0
|
||||
packet.m_body = (*byte)(incBytePtr(unsafe.Pointer(&pbuf[0]),
|
||||
int(RTMP_MAX_HEADER_SIZE)))
|
||||
packet.m_body = &pbuf[RTMP_MAX_HEADER_SIZE]
|
||||
|
||||
enc = (*byte)(unsafe.Pointer(packet.m_body))
|
||||
enc = C_AMF_EncodeString(enc, pend, &av_createStream)
|
||||
|
@ -902,8 +900,7 @@ func C_SendReleaseStream(r *C_RTMP) int32 {
|
|||
packet.m_nTimeStamp = 0
|
||||
packet.m_nInfoField2 = 0
|
||||
packet.m_hasAbsTimestamp = 0
|
||||
packet.m_body = (*byte)(incBytePtr(unsafe.Pointer(&pbuf[0]),
|
||||
int(RTMP_MAX_HEADER_SIZE)))
|
||||
packet.m_body = &pbuf[RTMP_MAX_HEADER_SIZE]
|
||||
|
||||
enc = (*byte)(unsafe.Pointer(packet.m_body))
|
||||
enc = C_AMF_EncodeString(enc, pend, &av_releaseStream)
|
||||
|
@ -936,8 +933,7 @@ func C_SendFCPublish(r *C_RTMP) int32 {
|
|||
packet.m_nTimeStamp = 0
|
||||
packet.m_nInfoField2 = 0
|
||||
packet.m_hasAbsTimestamp = 0
|
||||
packet.m_body = (*byte)(incBytePtr(unsafe.Pointer(&pbuf[0]),
|
||||
int(RTMP_MAX_HEADER_SIZE)))
|
||||
packet.m_body = &pbuf[RTMP_MAX_HEADER_SIZE]
|
||||
|
||||
enc = (*byte)(unsafe.Pointer(packet.m_body))
|
||||
enc = C_AMF_EncodeString(enc, pend, &av_FCPublish)
|
||||
|
@ -1006,8 +1002,7 @@ func C_SendPublish(r *C_RTMP) int32 {
|
|||
packet.m_nTimeStamp = 0
|
||||
packet.m_nInfoField2 = int32(r.m_stream_id)
|
||||
packet.m_hasAbsTimestamp = 0
|
||||
packet.m_body = (*byte)(incBytePtr(unsafe.Pointer(&pbuf[0]),
|
||||
int(RTMP_MAX_HEADER_SIZE)))
|
||||
packet.m_body = &pbuf[RTMP_MAX_HEADER_SIZE]
|
||||
|
||||
enc = (*byte)(unsafe.Pointer(packet.m_body))
|
||||
enc = C_AMF_EncodeString(enc, pend, &av_publish)
|
||||
|
@ -1045,8 +1040,7 @@ func C_SendBytesReceived(r *C_RTMP) int {
|
|||
packet.m_nTimeStamp = 0
|
||||
packet.m_nInfoField2 = 0
|
||||
packet.m_hasAbsTimestamp = 0
|
||||
packet.m_body = (*byte)(incBytePtr(unsafe.Pointer(&pbuf[0]),
|
||||
RTMP_MAX_HEADER_SIZE))
|
||||
packet.m_body = &pbuf[RTMP_MAX_HEADER_SIZE]
|
||||
|
||||
packet.m_nBodySize = 4
|
||||
|
||||
|
@ -1072,8 +1066,7 @@ func C_SendCheckBW(r *C_RTMP) int32 {
|
|||
packet.m_nTimeStamp = 0
|
||||
packet.m_nInfoField2 = 0
|
||||
packet.m_hasAbsTimestamp = 0
|
||||
packet.m_body = (*byte)(incBytePtr(unsafe.Pointer(&pbuf[0]),
|
||||
int(RTMP_MAX_HEADER_SIZE)))
|
||||
packet.m_body = &pbuf[RTMP_MAX_HEADER_SIZE]
|
||||
|
||||
enc = (*byte)(unsafe.Pointer(packet.m_body))
|
||||
enc = C_AMF_EncodeString(enc, pend, &av__checkbw)
|
||||
|
|
Loading…
Reference in New Issue