From fbad21bc76af71deca65e924229c6ef643130064 Mon Sep 17 00:00:00 2001 From: scruzin Date: Sun, 20 Jan 2019 08:52:58 +1030 Subject: [PATCH] connect() now constructs its packet with a buf to avoid needless packet resizing later. --- rtmp/rtmp.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rtmp/rtmp.go b/rtmp/rtmp.go index 1175e8ce..a6897eef 100644 --- a/rtmp/rtmp.go +++ b/rtmp/rtmp.go @@ -186,8 +186,10 @@ func connect(c *Conn) error { return err } c.log(DebugLevel, pkg+"negotiating") + + var buf [256]byte for !c.isPlaying { - pkt := packet{} + pkt := packet{buf: buf[:]} err = pkt.readFrom(c) if err != nil { break