pull/141/head
q191201771 3 years ago
parent 4e0db49b18
commit 9969144c89

@ -70,12 +70,12 @@ func (r *Rtmp2RtspRemuxer) FeedRtmpMsg(msg base.RtmpMsg) {
case base.RtmpTypeIdMetadata:
return
case base.RtmpTypeIdAudio:
if len(msg.Payload) <= 5 {
if len(msg.Payload) <= 2 {
Log.Warnf("rtmp msg too short, ignore. header=%+v, payload=%s", msg.Header, hex.Dump(msg.Payload))
return
}
case base.RtmpTypeIdVideo:
if len(msg.Payload) <= 2 {
if len(msg.Payload) <= 5 {
Log.Warnf("rtmp msg too short, ignore. header=%+v, payload=%s", msg.Header, hex.Dump(msg.Payload))
return
}
@ -104,10 +104,6 @@ func (r *Rtmp2RtspRemuxer) FeedRtmpMsg(msg base.RtmpMsg) {
}
if msg.IsAacSeqHeader() {
if len(msg.Payload) < 3 {
Log.Warnf("aac seq header payload too short. len=%d, payload=%s", len(msg.Payload), hex.Dump(msg.Payload))
return
}
r.asc = msg.Clone().Payload[2:]
r.doAnalyze()
return
@ -178,10 +174,6 @@ func (r *Rtmp2RtspRemuxer) remux(msg base.RtmpMsg) {
var rtppkts []rtprtcp.RtpPacket
switch msg.Header.MsgTypeId {
case base.RtmpTypeIdAudio:
if len(msg.Payload) < 3 {
Log.Warnf("aac seq header payload too short. len=%d, payload=%s", len(msg.Payload), hex.Dump(msg.Payload))
return
}
packer = r.getAudioPacker()
if packer != nil {
rtppkts = packer.Pack(base.AvPacket{
@ -191,10 +183,6 @@ func (r *Rtmp2RtspRemuxer) remux(msg base.RtmpMsg) {
})
}
case base.RtmpTypeIdVideo:
if len(msg.Payload) < 6 {
Log.Warnf("Video seq header payload too short. len=%d, payload=%s", len(msg.Payload), hex.Dump(msg.Payload))
return
}
packer = r.getVideoPacker()
if packer != nil {
rtppkts = r.getVideoPacker().Pack(base.AvPacket{

Loading…
Cancel
Save