diff --git a/rtmp/rtmp.go b/rtmp/rtmp.go index b9121c66..eb2bb394 100644 --- a/rtmp/rtmp.go +++ b/rtmp/rtmp.go @@ -54,7 +54,6 @@ const ( ) const ( - // av_setDataFrame is a static const global in rtmp.c setDataFrame = "@setDataFrame" av__checkbw = "_checkbw" @@ -870,8 +869,6 @@ leave: return nil } -// int HandShake(RTMP* r, int FP9HandShake); -// rtmp.c +3744 func handshake(s *Session, FP9HandShake int32) error { var clientbuf [RTMP_SIG_SIZE + 1]byte clientsig := clientbuf[1:] @@ -937,7 +934,7 @@ func handshake(s *Session, FP9HandShake int32) error { // write prepares data to write then sends it. func (s *Session) write(buf []byte) error { - var pkt = &s.write + var pkt packet var enc []byte size := len(buf) var num int @@ -974,7 +971,7 @@ func (s *Session) write(buf []byte) error { pkt.bodySize += 16 } - resizePacket(pkt, pkt.bodySize, headerType) + resizePacket(&pkt, pkt.bodySize, headerType) enc = pkt.body[:pkt.bodySize] if pkt.packetType == RTMP_PACKET_TYPE_INFO { @@ -997,7 +994,7 @@ func (s *Session) write(buf []byte) error { pkt.bytesRead += uint32(num) buf = buf[num:] if pkt.bytesRead == pkt.bodySize { - err := sendPacket(s, pkt, 0) + err := sendPacket(s, &pkt, 0) pkt.body = nil pkt.bytesRead = 0 if err != nil { diff --git a/rtmp/session.go b/rtmp/session.go index 869a9733..5cdd8924 100644 --- a/rtmp/session.go +++ b/rtmp/session.go @@ -62,7 +62,6 @@ type Session struct { audioCodecs float64 videoCodecs float64 encoding float64 - write packet defered []byte link link }