]> git.ipfire.org Git - thirdparty/asterisk.git/commit
remove empty audiohook write list on channel
authorDavid Vossel <dvossel@digium.com>
Tue, 27 Jul 2010 20:33:40 +0000 (20:33 +0000)
committerDavid Vossel <dvossel@digium.com>
Tue, 27 Jul 2010 20:33:40 +0000 (20:33 +0000)
commit0ebd53bba854f41347caa3a035649d0ae225fd0c
tree340c691b4ae2ee8e1c034c9b9fb9f4ecd2dab7d7
parent13e5091b723e830e74c3f7b2658f571e1c31eb8c
remove empty audiohook write list on channel

If a channel has an audiohook write list created on it, that
list stays on the channel until the channel is destroyed.  There
is no reason to keep that list on the channel if it becomes empty.
If it is empty that just means we are doing needless translating
for every ast_read and ast_write.  This patch removes the audiohook
list from the channel once it is detected to be empty on either a
read or write.  If a audiohook is added back to the channel after
this list is destroyed, the list just gets recreated as if it never
existed to begin with.

(closes issue #17630)
Reported by: manvirr

Review: https://reviewboard.asterisk.org/r/799/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@279945 65c4cc65-6c06-0410-ace0-fbb531ad65f3
include/asterisk/audiohook.h
main/audiohook.c
main/channel.c