[test] 去掉单元测试时不必要的错误日志

pull/114/head
q191201771 3 years ago
parent cbdd28f2de
commit 151db29064

@ -42,6 +42,12 @@ const (
RtmpCodecIdAvc uint8 = 7
RtmpCodecIdHevc uint8 = 12
// RtmpAvcPacketTypeSeqHeader RtmpAvcPacketTypeNalu RtmpHevcPacketTypeSeqHeader RtmpHevcPacketTypeNalu
// 注意按照标准文档上描述PacketType还有可能为2
// 2: AVC end of sequence (lower level NALU sequence ender is not required or supported)
//
// 我自己遇到过在流结尾时,对端发送 27 02 00 00 00的情况比如我们的使用wontcry.flv的单元测试最后一个包
//
RtmpAvcPacketTypeSeqHeader uint8 = 0
RtmpAvcPacketTypeNalu uint8 = 1
RtmpHevcPacketTypeSeqHeader = RtmpAvcPacketTypeSeqHeader

@ -10,7 +10,6 @@ package hls
import (
"encoding/hex"
"github.com/q191201771/lal/pkg/aac"
"github.com/q191201771/lal/pkg/avc"
"github.com/q191201771/lal/pkg/base"
@ -99,6 +98,8 @@ func (s *Streamer) feedVideo(msg base.RtmpMsg) {
nazalog.Errorf("[%s] invalid video message length. len=%d", s.UniqueKey, len(msg.Payload))
return
}
//nazalog.Debugf("[%s] feed video. header=%+v, payload=%s", s.UniqueKey, msg.Header, hex.Dump(nazastring.SubSliceSafety(msg.Payload, 16)))
codecId := msg.Payload[0] & 0xF
if codecId != base.RtmpCodecIdAvc && codecId != base.RtmpCodecIdHevc {
return
@ -130,6 +131,9 @@ func (s *Streamer) feedVideo(msg base.RtmpMsg) {
// msg中可能有多个NALU逐个获取
nals, err := avc.SplitNaluAvcc(msg.Payload[5:])
if err != nil {
// 注意有一种情况是msg.Payload为 27 02 00 00 00
// 此时打印错误并返回也不影响
//
nazalog.Errorf("[%s] iterate nalu failed. err=%+v, header=%+v, payload=%s", err, s.UniqueKey, msg.Header, hex.Dump(nazastring.SubSliceSafety(msg.Payload, 32)))
return
}

@ -127,7 +127,7 @@ func InnerTestEntry(t *testing.T) {
assert.Equal(t, nil, err)
httpflvPullTagCount.Increment()
})
nazalog.Error(err)
nazalog.Assert(nil, err)
}()
time.Sleep(200 * time.Millisecond)

Loading…
Cancel
Save