[asterisk-commits] seanbright: branch 1.8 r349144 - /branches/1.8/main/audiohook.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Dec 27 11:09:20 CST 2011


Author: seanbright
Date: Tue Dec 27 11:09:14 2011
New Revision: 349144

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=349144
Log:
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.

Modified:
    branches/1.8/main/audiohook.c

Modified: branches/1.8/main/audiohook.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/audiohook.c?view=diff&rev=349144&r1=349143&r2=349144
==============================================================================
--- branches/1.8/main/audiohook.c (original)
+++ branches/1.8/main/audiohook.c Tue Dec 27 11:09:14 2011
@@ -621,6 +621,12 @@
 	struct ast_audiohook *audiohook = NULL;
 	int samples = frame->samples;
 
+	/* 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 the frame coming in is not signed linear we have to send it through the in_translate path */
 	if (frame->subclass.codec != AST_FORMAT_SLINEAR) {




More information about the asterisk-commits mailing list