changeset 25:e67b3bb87d1b

RTP Tx: network byte order
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 07 Jul 2024 17:41:19 +0000
parents 84d427017d2f
children f71efdd08c33
files src/rtp_tx.c
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/rtp_tx.c	Sun Jul 07 07:33:48 2024 +0000
+++ b/src/rtp_tx.c	Sun Jul 07 17:41:19 2024 +0000
@@ -6,6 +6,7 @@
 #include <stdbool.h>
 #include <string.h>
 #include <errno.h>
+#include <arpa/inet.h>	/* for network byte order functions */
 
 #include <osmocom/core/msgb.h>
 #include <osmocom/core/osmo_io.h>
@@ -71,9 +72,9 @@
 	rtph->m_pt = payload_type;
 	if (marker)
 		rtph->m_pt |= 0x80;
-	rtph->ssrc = endp->tx.ssrc;
-	rtph->seq = endp->tx.seq;
-	rtph->tstamp = endp->tx.ts;
+	rtph->ssrc = htonl(endp->tx.ssrc);
+	rtph->seq = htons(endp->tx.seq);
+	rtph->tstamp = htonl(endp->tx.ts);
 	pl_out = msgb_put(msg, payload_len);
 	memcpy(pl_out, payload, payload_len);
 	endp->tx.seq++;