From eda8eddf5a30f9c9109b891c59abdb7f0f2c32fc Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Tue, 14 Dec 2021 22:30:15 +0100 Subject: [PATCH] hls: cleanup --- internal/hls/muxer_ts_generator.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/hls/muxer_ts_generator.go b/internal/hls/muxer_ts_generator.go index 40b91604..bbd6eae5 100644 --- a/internal/hls/muxer_ts_generator.go +++ b/internal/hls/muxer_ts_generator.go @@ -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) }