diff src/rtp_tx.c @ 27:a0b89c028053

RTP Tx: implement skip operation
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 07 Jul 2024 18:39:24 +0000
parents f71efdd08c33
children defe58aa537c
line wrap: on
line diff
--- a/src/rtp_tx.c	Sun Jul 07 18:30:44 2024 +0000
+++ b/src/rtp_tx.c	Sun Jul 07 18:39:24 2024 +0000
@@ -43,8 +43,10 @@
 		return -EINVAL;
 	msg = msgb_alloc_c(endp, sizeof(struct rtp_basic_hdr) + payload_len,
 			   "ThemWi-RTP-Tx");
-	if (!msg)
+	if (!msg) {
+		twrtp_endp_tx_skip(endp);
 		return -ENOMEM;
+	}
 
 	/* timestamp generation is where we do some trickery */
 	osmo_clock_gettime(CLOCK_REALTIME, &now);
@@ -94,3 +96,10 @@
 
 	return 0;
 }
+
+void twrtp_endp_tx_skip(struct twrtp_endp *endp)
+{
+	if (!endp->tx.started || endp->tx.restart)
+		return;
+	endp->tx.ts += endp->twjit->ts_quantum;
+}