Skip to content

Commit

Permalink
RTMP client: do not print errors in case of fragmented AAC frames
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 committed Apr 5, 2021
1 parent 6077814 commit 7fab9e5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/clientrtmp/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,6 @@ func (c *Client) runRead() {
// send them together.
marker := (pair.buf[1] >> 7 & 0x1) > 0
if marker {
c.conn.NetConn().SetWriteDeadline(time.Now().Add(c.writeTimeout))

dts := time.Since(videoStartDTS)

// avoid duplicate DTS
Expand All @@ -336,6 +334,7 @@ func (c *Client) runRead() {
}
videoLastDTS = dts

c.conn.NetConn().SetWriteDeadline(time.Now().Add(c.writeTimeout))
err := c.conn.WriteH264(videoBuf, dts)
if err != nil {
return err
Expand All @@ -346,7 +345,9 @@ func (c *Client) runRead() {
} else if audioTrack != nil && pair.trackID == audioTrack.ID {
aus, pts, err := aacDecoder.Decode(pair.buf)
if err != nil {
c.log(logger.Warn, "unable to decode audio track: %v", err)
if err != rtpaac.ErrMorePacketsNeeded {
c.log(logger.Warn, "unable to decode audio track: %v", err)
}
continue
}

Expand Down

0 comments on commit 7fab9e5

Please sign in to comment.