mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 12:16:00 +00:00
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
This commit is contained in:
@@ -402,8 +402,11 @@ static int framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
|
|||||||
pvt->f.seqno = f->seqno;
|
pvt->f.seqno = f->seqno;
|
||||||
|
|
||||||
if (f->samples == 0) {
|
if (f->samples == 0) {
|
||||||
|
/* Do not log empty audio frame */
|
||||||
|
if (strcasecmp(f->src, "ast_prod")) {
|
||||||
ast_log(LOG_WARNING, "no samples for %s\n", pvt->t->name);
|
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 (pvt->t->buffer_samples) { /* do not pass empty frames to callback */
|
||||||
if (f->datalen == 0) { /* perform native PLC if available */
|
if (f->datalen == 0) { /* perform native PLC if available */
|
||||||
/* If the codec has native PLC, then do that */
|
/* If the codec has native PLC, then do that */
|
||||||
|
Reference in New Issue
Block a user