Fix ADTStoRTP parser

This commit is contained in:
Alexey Khit
2023-08-20 16:33:52 +03:00
parent 2e4e75e386
commit 32bf64028d
+1 -1
View File
@@ -79,7 +79,7 @@ func RTPPay(handler core.HandlerFunc) core.HandlerFunc {
func ADTStoRTP(src []byte) (dst []byte) {
dst = make([]byte, 2) // header bytes
for i := 0; i < len(src); {
for i, n := 0, len(src)-ADTSHeaderSize; i < n; {
auSize := ReadADTSSize(src[i:])
dst = append(dst, byte(auSize>>5), byte(auSize<<3)) // size in bits
i += int(auSize)