shithub: rtmp

Download patch

ref: e1f124cc4dfabb7e64ec8f94365d9d38e54acd81
parent: 700d40f0a6a3749f4ea3f680d9098542b842c9a6
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Thu Aug 12 13:04:44 EDT 2021

dt → ts

--- a/rtmp.c
+++ b/rtmp.c
@@ -817,7 +817,7 @@
 }
 
 static int
-h264data(RTMP *r, ulong sid, u32int dt, u8int *p, int sz)
+h264data(RTMP *r, ulong sid, u32int ts, u8int *p, int sz)
 {
 	u8int *p₀, sps[128], pps[128], ps[16+sizeof(sps)+sizeof(pps)];
 	int sz₀, csz, nsz, ntype, spssz, ppssz, key, total;
@@ -881,7 +881,7 @@
 	bextend(&r->o, 64+total);
 
 	newmsg(r, Video, Type0, CSData);
-	r->o.msg.ts = dt;
+	r->o.msg.ts = ts;
 	r->o.msg.sid = sid;
 
 	putbyte((key ? 0x10 : 0x20) | VcodecH264);
@@ -902,7 +902,7 @@
 }
 
 static int
-aacdata(RTMP *r, ulong sid, u32int dt, u8int *p, int sz)
+aacdata(RTMP *r, ulong sid, u32int ts, u8int *p, int sz)
 {
 	int chanc, ratei, objt;
 	u16int x;
@@ -953,7 +953,7 @@
 	bextend(&r->o, sz);
 
 	newmsg(r, Audio, Type0, CSData);
-	r->o.msg.ts = dt;
+	r->o.msg.ts = ts;
 	r->o.msg.sid = sid;
 
 	putbyte(AcodecAAC<<4 | 0xf);
@@ -965,7 +965,7 @@
 }
 
 int
-rtmpdata(RTMP *r, ulong sid, u32int dt, int type, void *p, int sz)
+rtmpdata(RTMP *r, ulong sid, u32int ts, int type, void *p, int sz)
 {
 	int res;
 
@@ -972,7 +972,7 @@
 	assert(type == Taudio || type == Tvideo);
 
 	qlock(r);
-	res = (type == Tvideo ? h264data : aacdata)(r, sid, dt, p, sz);
+	res = (type == Tvideo ? h264data : aacdata)(r, sid, ts, p, sz);
 	qunlock(r);
 
 	return res;
--- a/rtmp.h
+++ b/rtmp.h
@@ -21,7 +21,7 @@
 	Taudio,
 	Tvideo,
 };
-int rtmpdata(RTMP *r, ulong sid, u32int dt, int type, void *data, int sz);
+int rtmpdata(RTMP *r, ulong sid, u32int ts, int type, void *data, int sz);
 
 RTMP *rtmpdial(char *url);
 void rtmpclose(RTMP *r);