[asterisk-commits] russell: trunk r182553 - /trunk/main/channel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Mar 17 10:22:19 CDT 2009


Author: russell
Date: Tue Mar 17 10:22:12 2009
New Revision: 182553

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=182553
Log:
Tweak the handling of the frame list inside of ast_answer().

This does not change any behavior, but moves the frames from the local frame
list back to the channel read queue using an O(n) algorithm instead of O(n^2).

Modified:
    trunk/main/channel.c

Modified: trunk/main/channel.c
URL: http://svn.digium.com/svn-view/asterisk/trunk/main/channel.c?view=diff&rev=182553&r1=182552&r2=182553
==============================================================================
--- trunk/main/channel.c (original)
+++ trunk/main/channel.c Tue Mar 17 10:22:12 2009
@@ -1801,7 +1801,7 @@
 					ast_frfree(cur);
 				}
 
-				AST_LIST_INSERT_TAIL(&frames, new, frame_list);
+				AST_LIST_INSERT_HEAD(&frames, new, frame_list);
 
 				/* if a specific delay period was requested, continue
 				 * until that delay has passed. don't stop just because
@@ -1837,8 +1837,7 @@
 
 			if (res == 0) {
 				ast_channel_lock(chan);
-				while ((cur = AST_LIST_LAST(&frames))) {
-					AST_LIST_REMOVE(&frames, cur, frame_list);
+				while ((cur = AST_LIST_REMOVE_HEAD(&frames, frame_list))) {
 					ast_queue_frame_head(chan, cur);
 					ast_frfree(cur);
 				}




More information about the asterisk-commits mailing list