From c55363752122d68d2577597191227f817a87b27d Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Sat, 11 Jul 2020 23:54:10 -0700 Subject: [PATCH] Cleanup --- core/rtmp/rtmp.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/core/rtmp/rtmp.go b/core/rtmp/rtmp.go index 3bd3ad51d..f59fa3cb0 100644 --- a/core/rtmp/rtmp.go +++ b/core/rtmp/rtmp.go @@ -18,7 +18,6 @@ import ( "github.com/gabek/owncast/core" "github.com/gabek/owncast/core/ffmpeg" "github.com/gabek/owncast/utils" - "github.com/nareix/joy5/codec/h264" "github.com/nareix/joy5/format/rtmp" ) @@ -98,21 +97,22 @@ func HandleConn(c *rtmp.Conn, nc net.Conn) { for { pkt, err := c.ReadPacket() - if err != nil { - if err == io.EOF { - handleDisconnect(nc) - } + if err == io.EOF { + handleDisconnect(nc) + return } - if pkt.Type == av.H264 { - nalus, _ := h264.SplitNALUs(pkt.Data) - annexb := h264.JoinNALUsAnnexb(nalus) - avcc := h264.JoinNALUsAVCC([][]byte{annexb}) - pkt.Data = avcc - } else if pkt.Type == av.Metadata { + if pkt.Type == av.Metadata { log.Traceln(string(pkt.Data)) } + // if pkt.Type == av.H264 { + // nalus, _ := h264.SplitNALUs(pkt.Data) + // annexb := h264.JoinNALUsAnnexb(nalus) + // avcc := h264.JoinNALUsAVCC([][]byte{annexb}) + // pkt.Data = avcc + // } + if err := w.WritePacket(pkt); err != nil { panic(err) }