From 7bb9fcc2c7a625180e933f072c9a6fdfd07abda4 Mon Sep 17 00:00:00 2001 From: scruzin Date: Fri, 11 Jan 2019 00:10:29 +1030 Subject: [PATCH] Remove superfluous call to handlePacket() from connectStream(). --- rtmp/rtmp.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/rtmp/rtmp.go b/rtmp/rtmp.go index bacf300a..e200387a 100644 --- a/rtmp/rtmp.go +++ b/rtmp/rtmp.go @@ -203,11 +203,10 @@ func connectStream(s *Session) error { case RTMP_PACKET_TYPE_AUDIO, RTMP_PACKET_TYPE_VIDEO, RTMP_PACKET_TYPE_INFO: s.log(WarnLevel, pkg+"got packet before play; ignoring", "type", pkt.packetType) default: - handlePacket(s, &pkt) // ignore errors - } - err = handlePacket(s, &pkt) - if err != nil { - break + err = handlePacket(s, &pkt) + if err != nil { + break + } } } @@ -221,7 +220,6 @@ func connectStream(s *Session) error { // NB: cases have been commented out that are not currently used by AusOcean func handlePacket(s *Session, pkt *packet) error { switch pkt.packetType { - case RTMP_PACKET_TYPE_CHUNK_SIZE: if pkt.bodySize >= 4 { s.inChunkSize = int32(C_AMF_DecodeInt32(pkt.body[:4]))