From: Mike Jerris Date: Fri, 13 Jul 2018 19:13:24 +0000 (-0400) Subject: FS-11230: [core] Fix bad rtp timestamps triggered by cng/missed packet detection X-Git-Tag: v1.8.1~3^2~214 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e3da931e519c2dbba2f86762756b1f26f8318d8;p=thirdparty%2Ffreeswitch.git FS-11230: [core] Fix bad rtp timestamps triggered by cng/missed packet detection --- diff --git a/src/switch_rtp.c b/src/switch_rtp.c index afbd01a24e..a0efee7cf5 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -8166,7 +8166,7 @@ static int rtp_common_write(switch_rtp_t *rtp_session, #ifdef DEBUG_TS_ROLLOVER switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "WRITE TS LAST:%u THIS:%u DELTA:%u\n", rtp_session->last_write_ts, this_ts, ts_delta); #endif - if (!switch_rtp_ready(rtp_session) || rtp_session->sending_dtmf) { + if (ts_delta == 0 || !switch_rtp_ready(rtp_session) || rtp_session->sending_dtmf) { send = 0; } } @@ -8684,6 +8684,7 @@ SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp_t *rtp_session, switch_fra data = frame->data; len = frame->datalen; ts = rtp_session->flags[SWITCH_RTP_FLAG_RAW_WRITE] ? (uint32_t) frame->timestamp : 0; + if (!ts) ts = rtp_session->last_write_ts + rtp_session->samples_per_interval; } /*