go mod update

This commit is contained in:
deepch
2022-05-27 01:29:09 +03:00
parent 7d87dbe2dd
commit 2be4196875
3 changed files with 56 additions and 105 deletions

View File

@@ -10,6 +10,8 @@ import (
"strings"
"github.com/deepch/vdk/av"
"github.com/deepch/vdk/codec/aacparser"
"github.com/deepch/vdk/codec/h264parser"
)
type HandlerDemuxer struct {
@@ -310,3 +312,31 @@ func CopyFile(dst av.Muxer, src av.Demuxer) (err error) {
}
return
}
func Equal(c1 []av.CodecData, c2 []av.CodecData) bool {
if len(c1) != len(c2) {
return false
}
for i, codec := range c1 {
if codec.Type() != c2[i].Type() {
return false
}
switch codec.Type() {
case av.H264:
if eq := bytes.Compare(
codec.(h264parser.CodecData).AVCDecoderConfRecordBytes(),
c2[i].(h264parser.CodecData).AVCDecoderConfRecordBytes(),
); eq == 0 {
return false
}
case av.AAC:
if eq := bytes.Compare(
codec.(aacparser.CodecData).MPEG4AudioConfigBytes(),
c2[i].(aacparser.CodecData).MPEG4AudioConfigBytes(),
); eq != 0 {
return false
}
}
}
return true
}