various performance improvements (#561)

This commit is contained in:
Alessandro Ros
2024-05-05 11:20:22 +02:00
committed by GitHub
parent 8c26f5f00a
commit 9da49cdf63
5 changed files with 26 additions and 6 deletions

View File

@@ -142,7 +142,7 @@ func (f *H265) PTSEqualsDTS(pkt *rtp.Packet) bool {
case h265.NALUType_AggregationUnit:
payload := pkt.Payload[2:]
for len(payload) > 0 {
for {
if len(payload) < 2 {
return false
}
@@ -163,6 +163,10 @@ func (f *H265) PTSEqualsDTS(pkt *rtp.Packet) bool {
h265.NALUType_VPS_NUT, h265.NALUType_SPS_NUT, h265.NALUType_PPS_NUT:
return true
}
if len(payload) == 0 {
break
}
}
case h265.NALUType_FragmentationUnit: