From 150f16ae65670de86f5aebb2271369982d613c14 Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Sun, 20 Nov 2022 22:32:23 +0100 Subject: [PATCH] revert 15ec133 --- ptsequalsdts.go | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/ptsequalsdts.go b/ptsequalsdts.go index 09f08eb0..f3d71d7a 100644 --- a/ptsequalsdts.go +++ b/ptsequalsdts.go @@ -7,7 +7,7 @@ import ( ) // find IDR NALUs without decoding RTP -func rtpH264ContainsIDRorSPSorPPS(pkt *rtp.Packet) bool { +func rtpH264ContainsIDR(pkt *rtp.Packet) bool { if len(pkt.Payload) == 0 { return false } @@ -15,7 +15,7 @@ func rtpH264ContainsIDRorSPSorPPS(pkt *rtp.Packet) bool { typ := h264.NALUType(pkt.Payload[0] & 0x1F) switch typ { - case h264.NALUTypeIDR, h264.NALUTypeSPS, h264.NALUTypePPS: + case h264.NALUTypeIDR: return true case 24: // STAP-A @@ -37,8 +37,7 @@ func rtpH264ContainsIDRorSPSorPPS(pkt *rtp.Packet) bool { payload = payload[size:] typ = h264.NALUType(nalu[0] & 0x1F) - switch typ { - case h264.NALUTypeIDR, h264.NALUTypeSPS, h264.NALUTypePPS: + if typ == h264.NALUTypeIDR { return true } } @@ -56,11 +55,7 @@ func rtpH264ContainsIDRorSPSorPPS(pkt *rtp.Packet) bool { } typ := h264.NALUType(pkt.Payload[1] & 0x1F) - switch typ { - case h264.NALUTypeIDR, h264.NALUTypeSPS, h264.NALUTypePPS: - return true - } - return false + return (typ == h264.NALUTypeIDR) default: return false @@ -69,7 +64,7 @@ func rtpH264ContainsIDRorSPSorPPS(pkt *rtp.Packet) bool { func ptsEqualsDTS(track Track, pkt *rtp.Packet) bool { if _, ok := track.(*TrackH264); ok { - return rtpH264ContainsIDRorSPSorPPS(pkt) + return rtpH264ContainsIDR(pkt) } return true