]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res/res_rtp_asterisk: remove debug traces generated by an empty frame
authorneutrino88 <emmanuel.buu@ives.fr>
Tue, 21 Aug 2018 12:59:08 +0000 (08:59 -0400)
committerRichard Mudgett <rmudgett@digium.com>
Tue, 21 Aug 2018 23:24:48 +0000 (18:24 -0500)
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

res/res_rtp_asterisk.c

index 6f7e09eb4aab00f45790e3da4e4a3e8b71cd5999..e562627c92cde172ffb6b6a0aa4260b5acc40e74 100644 (file)
@@ -6058,7 +6058,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;