From: neutrino88 Date: Tue, 21 Aug 2018 12:59:08 +0000 (-0400) Subject: res/res_rtp_asterisk: remove debug traces generated by an empty frame X-Git-Tag: 15.6.0-rc1~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4e1a2c8fe12a4a483b9220606816c535888ed45;p=thirdparty%2Fasterisk.git res/res_rtp_asterisk: remove debug traces generated by an empty frame The realtime text timer pops regularly and sends text frames even if the buffer is empty. This causes a lot of unecessary debug logging. * Made red_write() test if we need to send a frame before calling ast_rtp_write() ASTERISK-28002 Reported by: Emmanuel BUU Tested by: Emmanuel BUU Change-Id: Icf81310c3b8080b615a42060afc02ab41f9523dd --- diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c index fa9e3250c0..c1aa2757ec 100644 --- a/res/res_rtp_asterisk.c +++ b/res/res_rtp_asterisk.c @@ -7382,7 +7382,9 @@ static int red_write(const void *data) struct ast_rtp *rtp = ast_rtp_instance_get_data(instance); ao2_lock(instance); - ast_rtp_write(instance, &rtp->red->t140); + if (rtp->red->t140.datalen > 0) { + ast_rtp_write(instance, &rtp->red->t140); + } ao2_unlock(instance); return 1;