Skip to content

Commit

Permalink
防止音频流无数据时 panic
Browse files Browse the repository at this point in the history
  • Loading branch information
ixugo committed Feb 23, 2024
1 parent 0beec39 commit 41eff79
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/remux/avpacket2rtmp.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,9 @@ func (r *AvPacket2RtmpRemuxer) FeedAvPacket(pkt base.AvPacket) {
}

length := len(pkt.Payload) - 5 // -7+2
if length < 7 {
return
}
payload := make([]byte, length)
payload[0] = 0xAF
payload[1] = base.RtmpAacPacketTypeRaw
Expand Down

0 comments on commit 41eff79

Please sign in to comment.