From 28de7aefa2f235d48f7e0c6cc1c1a6e3d86a11ad Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Sun, 4 Apr 2021 21:39:54 +0200 Subject: [PATCH] RTMP client: warn in case of decoding errors --- internal/clientrtmp/client.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/clientrtmp/client.go b/internal/clientrtmp/client.go index 3b1962ad..eca9956e 100644 --- a/internal/clientrtmp/client.go +++ b/internal/clientrtmp/client.go @@ -325,7 +325,7 @@ func (c *Client) runRead() { nts, err := c.h264Decoder.Decode(pair.buf) if err != nil { if err != rtph264.ErrMorePacketsNeeded { - c.log(logger.Debug, "ERR while decoding video track: %v", err) + c.log(logger.Warn, "unable to decode video track: %v", err) } continue } @@ -338,6 +338,7 @@ func (c *Client) runRead() { } // aggregate NALUs by PTS + // this delays the stream by one frame, but is required by RTMP if nt.Timestamp != videoPTS { c.conn.NetConn().SetWriteDeadline(time.Now().Add(c.writeTimeout)) err := c.conn.WriteH264(videoBuf, now.Sub(videoStartDTS)) @@ -354,7 +355,7 @@ func (c *Client) runRead() { } else if c.audioTrack != nil && pair.trackID == c.audioTrack.ID { ats, err := c.aacDecoder.Decode(pair.buf) if err != nil { - c.log(logger.Debug, "ERR while decoding audio track: %v", err) + c.log(logger.Warn, "unable to decode audio track: %v", err) continue }