aboutsummaryrefslogtreecommitdiffstats
path: root/main/channel.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-03-17 16:46:04 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-03-17 16:46:04 +0000
commitf61d4f537b671840ac0c9de951cbda8110f5a5de (patch)
treeb4fab7dd3335c4d306c19a58ff67ada4da99729e /main/channel.c
parent644da305d55c402f13cf71f28e92315e02b2559d (diff)
Merged revisions 182553 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r182553 | russell | 2009-03-17 10:22:12 -0500 (Tue, 17 Mar 2009) | 5 lines 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). ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@182592 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/channel.c')
-rw-r--r--main/channel.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/main/channel.c b/main/channel.c
index 8f90dcc29..782629312 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -1801,7 +1801,7 @@ int __ast_answer(struct ast_channel *chan, unsigned int delay, int cdr_answer)
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 @@ int __ast_answer(struct ast_channel *chan, unsigned int delay, int cdr_answer)
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);
}