# HG changeset patch # User Mychaela Falconia # Date 1679104781 28800 # Node ID eac3e0b6ce02b7b03ce7cd3b61f41913af576e96 # Parent a3d71489672fefb4896e1730ac8098d8b049066e sip-manual-out: (hopefully) fix RTP output timing diff -r a3d71489672f -r eac3e0b6ce02 sip-manual-out/main.c --- a/sip-manual-out/main.c Fri Mar 17 17:22:42 2023 -0800 +++ b/sip-manual-out/main.c Fri Mar 17 17:59:41 2023 -0800 @@ -159,12 +159,6 @@ bcopy(&cur_event_time, &next_rtp_out, sizeof(struct timeval)); rtp_out_running = 1; - } else { - next_rtp_out.tv_usec += 20000; - if (next_rtp_out.tv_usec >= 1000000) { - next_rtp_out.tv_sec++; - next_rtp_out.tv_usec -= 1000000; - } } if (timercmp(&cur_event_time, &next_rtp_out, <)) timersub(&next_rtp_out, &cur_event_time, @@ -194,7 +188,13 @@ rtp_rx_select(); if (FD_ISSET(rtcp_udp_fd, &fds)) rtcp_rx_select(); - if (rtp_out_running && (rc == 0)) + if (rtp_out_running && (rc == 0)) { generate_rtp_packet(); + next_rtp_out.tv_usec += 20000; + if (next_rtp_out.tv_usec >= 1000000) { + next_rtp_out.tv_sec++; + next_rtp_out.tv_usec -= 1000000; + } + } } }