shithub: rtmp

Download patch

ref: f68aad9c7e2b465cffecdd033e3a4c6612dfa40c
parent: 137e5118eff3bf3fd3eb47179940201409a96dec
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Fri Aug 13 06:09:22 EDT 2021

adts: skip 'nsec' packet

--- a/adts.c
+++ b/adts.c
@@ -29,6 +29,7 @@
 	int ratei, i;
 	u8int h[7];
 
+Again:
 	if(Bread(b, h, 7) != 7)
 		goto err;
 	if(h[0] != 0xff || (h[1]&0xf0) != 0xf0){
@@ -55,9 +56,11 @@
 	if(f->sz == 7+1+4+8 && f->buf[7] == 0x04 && memcmp(f->buf+7+1, "nsec", 4) == 0){
 		for(f->ns₀ = 0, i = 0; i < 8; i++)
 			f->ns₀ |= (uvlong)f->buf[7+1+4+i] << (i*8);
-	}else{
-		f->ns += 1000000000ULL * 1024ULL / ratecfg[ratei];
+		f->ns = 0;
+		goto Again;
 	}
+
+	f->ns += 1000000000ULL * 1024ULL / ratecfg[ratei];
 
 	return 0;