Fix ADTStoRTP parser
This commit is contained in:
+1
-1
@@ -79,7 +79,7 @@ func RTPPay(handler core.HandlerFunc) core.HandlerFunc {
|
|||||||
|
|
||||||
func ADTStoRTP(src []byte) (dst []byte) {
|
func ADTStoRTP(src []byte) (dst []byte) {
|
||||||
dst = make([]byte, 2) // header bytes
|
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:])
|
auSize := ReadADTSSize(src[i:])
|
||||||
dst = append(dst, byte(auSize>>5), byte(auSize<<3)) // size in bits
|
dst = append(dst, byte(auSize>>5), byte(auSize<<3)) // size in bits
|
||||||
i += int(auSize)
|
i += int(auSize)
|
||||||
|
|||||||
Reference in New Issue
Block a user