From a1c6ac945db159a907def86187ef6b6a77446de0 Mon Sep 17 00:00:00 2001 From: Mark Spencer <markster@digium.com> Date: Mon, 16 Feb 2004 15:05:21 +0000 Subject: [PATCH] Make sure smoother only creates frames with offsets (bug #1029) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2184 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- frame.c | 2 +- include/asterisk/frame.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frame.c b/frame.c index 97fe683d5c..06f714d0b1 100755 --- a/frame.c +++ b/frame.c @@ -80,7 +80,7 @@ int ast_smoother_feed(struct ast_smoother *s, struct ast_frame *f) ast_log(LOG_WARNING, "Out of smoother space\n"); return -1; } - if ((f->datalen == s->size) && !s->opt) { + if ((f->datalen == s->size) && !s->opt && (f->offset >= AST_MIN_OFFSET)) { if (!s->len) { /* Optimize by sending the frame we just got on the next read, thus eliminating the douple diff --git a/include/asterisk/frame.h b/include/asterisk/frame.h index 95b1f64051..2b645b52a4 100755 --- a/include/asterisk/frame.h +++ b/include/asterisk/frame.h @@ -90,10 +90,10 @@ struct ast_frame_chain { }; #define AST_FRIENDLY_OFFSET 64 /*! It's polite for a a new frame to - have at least this number of bytes - of offset before your real frame data - so that additional headers can be - added. */ + have this number of bytes for additional + headers. */ +#define AST_MIN_OFFSET 32 /*! Make sure we keep at least this much handy */ + /*! Need the header be free'd? */ #define AST_MALLOCD_HDR (1 << 0) /*! Need the data be free'd? */ -- GitLab