diff options
author | Joshua Colp <jcolp@digium.com> | 2007-08-08 19:30:52 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2007-08-08 19:30:52 +0000 |
commit | 602198c402ebf5d6b2fd82149b1377146c6b8814 (patch) | |
tree | d8f49fe3111f2586e86ed3583f8a44a1b2444e3f /main/slinfactory.c | |
parent | 082322685fc16b429595e66cb18d303301944fe0 (diff) |
Merge audiohooks branch into trunk. This is a new API for developers to listen and manipulate the audio going through a channel.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78649 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/slinfactory.c')
-rw-r--r-- | main/slinfactory.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/main/slinfactory.c b/main/slinfactory.c index a42b2b213..038fa0d7b 100644 --- a/main/slinfactory.c +++ b/main/slinfactory.c @@ -148,3 +148,21 @@ unsigned int ast_slinfactory_available(const struct ast_slinfactory *sf) { return sf->size; } + +void ast_slinfactory_flush(struct ast_slinfactory *sf) +{ + struct ast_frame *fr = NULL; + + if (sf->trans) { + ast_translator_free_path(sf->trans); + sf->trans = NULL; + } + + while ((fr = AST_LIST_REMOVE_HEAD(&sf->queue, frame_list))) + ast_frfree(fr); + + sf->size = sf->holdlen = 0; + sf->offset = sf->hold; + + return; +} |