mod update

This commit is contained in:
deepch
2023-03-12 00:32:08 +03:00
parent f567925cf9
commit cc3f215a23
3 changed files with 309 additions and 23 deletions

View File

@@ -247,8 +247,7 @@ func (element *Muxer) WritePacket(pkt av.Packet) (err error) {
if naltype == 5 {
codec := tmp.codec.(h264parser.CodecData)
err = tmp.track.WriteSample(media.Sample{Data: append([]byte{0, 0, 0, 1}, bytes.Join([][]byte{codec.SPS(), codec.PPS(), nalu}, []byte{0, 0, 0, 1})...), Duration: pkt.Duration})
} else if naltype == 1 {
} else {
err = tmp.track.WriteSample(media.Sample{Data: append([]byte{0, 0, 0, 1}, nalu...), Duration: pkt.Duration})
}
if err != nil {