Skip to content
Snippets Groups Projects
Commit a1c6ac94 authored by Mark Spencer's avatar Mark Spencer
Browse files

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
parent 509e9a4d
Branches
Tags
No related merge requests found
...@@ -80,7 +80,7 @@ int ast_smoother_feed(struct ast_smoother *s, struct ast_frame *f) ...@@ -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"); ast_log(LOG_WARNING, "Out of smoother space\n");
return -1; return -1;
} }
if ((f->datalen == s->size) && !s->opt) { if ((f->datalen == s->size) && !s->opt && (f->offset >= AST_MIN_OFFSET)) {
if (!s->len) { if (!s->len) {
/* Optimize by sending the frame we just got /* Optimize by sending the frame we just got
on the next read, thus eliminating the douple on the next read, thus eliminating the douple
......
...@@ -90,10 +90,10 @@ struct ast_frame_chain { ...@@ -90,10 +90,10 @@ struct ast_frame_chain {
}; };
#define AST_FRIENDLY_OFFSET 64 /*! It's polite for a a new frame to #define AST_FRIENDLY_OFFSET 64 /*! It's polite for a a new frame to
have at least this number of bytes have this number of bytes for additional
of offset before your real frame data headers. */
so that additional headers can be #define AST_MIN_OFFSET 32 /*! Make sure we keep at least this much handy */
added. */
/*! Need the header be free'd? */ /*! Need the header be free'd? */
#define AST_MALLOCD_HDR (1 << 0) #define AST_MALLOCD_HDR (1 << 0)
/*! Need the data be free'd? */ /*! Need the data be free'd? */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment