diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-01-04 18:32:23 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-01-04 18:32:23 +0000 |
commit | 7457dc351c9f7a80e380a19aca14be53a4794b83 (patch) | |
tree | 63f39f1a236462620dbe0abead5354426664f3de /channels/iax2-parser.c | |
parent | b3ec320ba748604cb7c016d03c05a792296ba236 (diff) |
Merged revisions 49465 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r49465 | kpfleming | 2007-01-04 12:31:55 -0600 (Thu, 04 Jan 2007) | 2 lines
only do IAX2 frame caching for voice and video frames
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@49466 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/iax2-parser.c')
-rw-r--r-- | channels/iax2-parser.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/channels/iax2-parser.c b/channels/iax2-parser.c index 14cac4836..eb3db17b0 100644 --- a/channels/iax2-parser.c +++ b/channels/iax2-parser.c @@ -939,7 +939,7 @@ void iax_frame_wrap(struct iax_frame *fr, struct ast_frame *f) } } -struct iax_frame *iax_frame_new(int direction, int datalen) +struct iax_frame *iax_frame_new(int direction, int datalen, unsigned int cacheable) { struct iax_frame *fr = NULL; @@ -969,6 +969,7 @@ struct iax_frame *iax_frame_new(int direction, int datalen) fr->direction = direction; fr->retrans = -1; + fr->cacheable = cacheable; if (fr->direction == DIRECTION_INGRESS) ast_atomic_fetchadd_int(&iframes, 1); @@ -996,7 +997,7 @@ void iax_frame_free(struct iax_frame *fr) ast_atomic_fetchadd_int(&frames, -1); #if !defined(LOW_MEMORY) - if (!(iax_frames = ast_threadstorage_get(&frame_cache, sizeof(*iax_frames)))) { + if (!fr->cacheable || !(iax_frames = ast_threadstorage_get(&frame_cache, sizeof(*iax_frames)))) { free(fr); return; } |