changeset 211:fbfa72b114e8

sip-manual-out: prep for making PCM fill octet changeable
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 21 May 2023 15:33:00 -0800
parents d96eaf2d6900
children b3aeacc5722a
files sip-manual-out/rtp_tx.c sip-manual-out/sdp_in.c
diffstat 2 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/sip-manual-out/rtp_tx.c	Sun May 07 21:55:01 2023 -0800
+++ b/sip-manual-out/rtp_tx.c	Sun May 21 15:33:00 2023 -0800
@@ -24,6 +24,8 @@
 static uint32_t rtp_out_ts;
 static uint16_t rtp_out_seq;
 
+static uint8_t pcm_fill_octet;
+
 static uint16_t tfo_fill_buf[9], tfo_req_buf[7];
 static uint16_t *is_out_ptr;
 static unsigned is_out_count;
@@ -36,6 +38,15 @@
 }
 
 void
+init_pcm_fill_octet()
+{
+	if (pcma_selected)
+		pcm_fill_octet = 0xD5;
+	else
+		pcm_fill_octet = 0xFF;
+}
+
+void
 prepare_tfo_fill()
 {
 	tfo_fill_buf[0] = 0x15A;
@@ -78,7 +89,7 @@
 	pkt.tstamp = htonl(rtp_out_ts);
 	rtp_out_ts += 160;
 	pkt.ssrc = rtp_ssrc;
-	memset(pkt.payload, pcma_selected ? 0xD5 : 0xFF, RTP_MAX_PAYLOAD);
+	memset(pkt.payload, pcm_fill_octet, RTP_MAX_PAYLOAD);
 	if (is_out_count) {
 		insert_is_msg(pkt.payload, *is_out_ptr++);
 		is_out_count--;
--- a/sip-manual-out/sdp_in.c	Sun May 07 21:55:01 2023 -0800
+++ b/sip-manual-out/sdp_in.c	Sun May 21 15:33:00 2023 -0800
@@ -73,5 +73,6 @@
 	rtp_remote_addr.sin_port = htons(sdp_parse.audio_port);
 	rtp_out_enable = 1;
 	assign_rtpout_ssrc();
+	init_pcm_fill_octet();
 	prepare_tfo_fill();
 }