improve performance

This commit is contained in:
aler9
2022-04-10 11:29:15 +02:00
parent bfe4e8cdaa
commit 7bf907e94c
6 changed files with 14 additions and 16 deletions

View File

@@ -123,8 +123,6 @@ func (d *Decoder) Decode(pkt *rtp.Packet) ([][]byte, time.Duration, error) {
}
start := pkt.Payload[1] >> 7
end := (pkt.Payload[1] >> 6) & 0x01
if start == 1 {
d.isDecodingFragmented = false
return nil, 0, fmt.Errorf("invalid FU-A packet (decoded two starting packets in a row)")
@@ -132,6 +130,7 @@ func (d *Decoder) Decode(pkt *rtp.Packet) ([][]byte, time.Duration, error) {
d.fragmentedBuffer = append(d.fragmentedBuffer, pkt.Payload[2:]...)
end := (pkt.Payload[1] >> 6) & 0x01
if end != 1 {
return nil, 0, ErrMorePacketsNeeded
}