rtmp: simplify body pointer setup

This commit is contained in:
Dan Kortschak 2018-09-06 11:11:29 +09:30
parent c31021149d
commit b7c148fd93
1 changed files with 7 additions and 14 deletions

View File

@ -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)