hls: cleanup

This commit is contained in:
aler9 2021-12-14 22:30:15 +01:00
parent de70566179
commit eda8eddf5a

View file

@ -98,15 +98,14 @@ func (m *muxerTSGenerator) writeH264(pts time.Duration, nalus [][]byte) error {
}
for _, nalu := range nalus {
// remove existing SPS, PPS, AUD
typ := h264.NALUType(nalu[0] & 0x1F)
switch typ {
case h264.NALUTypeSPS, h264.NALUTypePPS, h264.NALUTypeAccessUnitDelimiter:
// remove existing SPS, PPS, AUD
continue
}
// add SPS and PPS before every IDR
if typ == h264.NALUTypeIDR {
case h264.NALUTypeIDR:
// add SPS and PPS before every IDR
filteredNALUs = append(filteredNALUs, m.h264Conf.SPS, m.h264Conf.PPS)
}