summaryrefslogtreecommitdiff
path: root/main/audiohook.c
diff options
context:
space:
mode:
authorSean Bright <sean@malleable.com>2011-12-27 17:17:58 +0000
committerSean Bright <sean@malleable.com>2011-12-27 17:17:58 +0000
commit8017be6fa9e1c9e3fa0a98523c6e82d5eb239cdd (patch)
treea8ec146447d9f6880cbd935da8039a51c687bbd1 /main/audiohook.c
parentb0243fb57c03b8e98e8ccb7e08c3215c42c0bc8b (diff)
Once an audiohook is attached to a channel, we continue to transcode all of the
frames, even after all of the hooks are detached. This patch short-cicuits us out before we transcode unnecessarily. ........ Merged revisions 349144 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 349145 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349146 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/audiohook.c')
-rw-r--r--main/audiohook.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/main/audiohook.c b/main/audiohook.c
index 83fec318f..02207443b 100644
--- a/main/audiohook.c
+++ b/main/audiohook.c
@@ -783,6 +783,12 @@ static struct ast_frame *audio_audiohook_write_list(struct ast_channel *chan, st
int middle_frame_manipulated = 0;
int removed = 0;
+ /* Don't translate our frame if we aren't going to bother to use it */
+ if (AST_LIST_EMPTY(&audiohook_list->spy_list)
+ && AST_LIST_EMPTY(&audiohook_list->whisper_list)
+ && AST_LIST_EMPTY(&audiohook_list->manipulate_list))
+ return end_frame;
+
/* ---Part_1. translate start_frame to SLINEAR if necessary. */
if (!(middle_frame = audiohook_list_translate_to_slin(audiohook_list, direction, start_frame))) {
return frame;