move MaxNALUSize / MaxAccessUnitSize into h264 / aac

This commit is contained in:
aler9
2022-05-10 13:16:39 +02:00
parent 18f7fab361
commit e60809efe1
9 changed files with 17 additions and 21 deletions

View File

@@ -8,6 +8,7 @@ import (
"github.com/pion/rtp"
"github.com/aler9/gortsplib/pkg/h264"
"github.com/aler9/gortsplib/pkg/rtptimedec"
)
@@ -139,10 +140,10 @@ func (d *Decoder) Decode(pkt *rtp.Packet) ([][]byte, time.Duration, error) {
}
d.fragmentedSize += len(pkt.Payload[2:])
if d.fragmentedSize > maxNALUSize {
if d.fragmentedSize > h264.MaxNALUSize {
d.fragmentedParts = d.fragmentedParts[:0]
d.fragmentedMode = false
return nil, 0, fmt.Errorf("NALU size (%d) is too big (maximum is %d)", d.fragmentedSize, maxNALUSize)
return nil, 0, fmt.Errorf("NALU size (%d) is too big (maximum is %d)", d.fragmentedSize, h264.MaxNALUSize)
}
d.fragmentedParts = append(d.fragmentedParts, pkt.Payload[2:])