[Asterisk-code-review] translate.c do not log WARNING on empty audio frame (...asterisk[16])

Alexei Gradinari asteriskteam at digium.com
Fri Jun 14 16:06:27 CDT 2019


Alexei Gradinari has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/11473


Change subject: translate.c do not log WARNING on empty audio frame
......................................................................

translate.c do not log WARNING on empty audio frame

There is WARNING "no samples for ..." on each Playtones.
The function ast_playtones_start calls ast_activate_generator,
which calls ast_prod.
The function ast_prod calls ast_write with empty audio frame.
In this case it's spam log.

Change-Id: Id4ac309489d9ff281bad02abdef341cecdede660
---
M main/translate.c
1 file changed, 4 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/73/11473/1

diff --git a/main/translate.c b/main/translate.c
index 26f9c9b..fe46460 100644
--- a/main/translate.c
+++ b/main/translate.c
@@ -402,7 +402,10 @@
 	pvt->f.seqno = f->seqno;
 
 	if (f->samples == 0) {
-		ast_log(LOG_WARNING, "no samples for %s\n", pvt->t->name);
+		/* Do not log empty audio frame */
+		if (strcasecmp(f->src, "ast_prod")) {
+			ast_log(LOG_WARNING, "no samples for %s\n", pvt->t->name);
+		}
 	}
 	if (pvt->t->buffer_samples) {	/* do not pass empty frames to callback */
 		if (f->datalen == 0) { /* perform native PLC if available */

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/11473
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: Id4ac309489d9ff281bad02abdef341cecdede660
Gerrit-Change-Number: 11473
Gerrit-PatchSet: 1
Gerrit-Owner: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190614/8975e859/attachment.html>


More information about the asterisk-code-review mailing list