summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
Diffstat (limited to 'channels')
-rw-r--r--channels/iax2/parser.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/channels/iax2/parser.c b/channels/iax2/parser.c
index ec9d34608..6eda98260 100644
--- a/channels/iax2/parser.c
+++ b/channels/iax2/parser.c
@@ -1296,7 +1296,9 @@ void iax_frame_free(struct iax_frame *fr)
ast_atomic_fetchadd_int(&frames, -1);
#if !defined(LOW_MEMORY)
- if (!fr->cacheable || !(iax_frames = ast_threadstorage_get(&frame_cache, sizeof(*iax_frames)))) {
+ if (!fr->cacheable
+ || !ast_opt_cache_media_frames
+ || !(iax_frames = ast_threadstorage_get(&frame_cache, sizeof(*iax_frames)))) {
ast_free(fr);
return;
}