aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-04-14 15:02:43 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-04-14 15:02:43 +0000
commit019856c051215238befe222cf4d091419056d9f3 (patch)
tree4bbb8621a16a844d22599fe76ab04bbf46648ae4 /main
parente35b3f65c81670f9def6cec0aa0ea1a7e0d2587f (diff)
Merged revisions 114107 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r114107 | mmichelson | 2008-04-14 10:01:36 -0500 (Mon, 14 Apr 2008) | 13 lines Merged revisions 114106 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r114106 | mmichelson | 2008-04-14 09:58:02 -0500 (Mon, 14 Apr 2008) | 5 lines Save a local copy of the generate callback prior to unlocking the channel in case the generate callback goes NULL on us after the channel is unlocked. Thanks to Russell for pointing this need out to me. ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@114108 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/channel.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/main/channel.c b/main/channel.c
index 478d9bdd8..5241ff8a3 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -2255,6 +2255,7 @@ static void ast_read_generator_actions(struct ast_channel *chan, struct ast_fram
{
if (chan->generatordata && !ast_internal_timing_enabled(chan)) {
void *tmp = chan->generatordata;
+ int (*generate)(struct ast_channel *chan, void *tmp, int datalen, int samples) = NULL;
int res;
int samples;
@@ -2273,6 +2274,10 @@ static void ast_read_generator_actions(struct ast_channel *chan, struct ast_fram
} else {
samples = f->samples;
}
+
+ if (chan->generator->generate) {
+ generate = chan->generator->generate;
+ }
/* This unlock is here based on two assumptions that hold true at this point in the
* code. 1) this function is only called from within __ast_read() and 2) all generators
* call ast_write() in their generate callback.
@@ -2282,7 +2287,7 @@ static void ast_read_generator_actions(struct ast_channel *chan, struct ast_fram
* avoidance not to work in deeper functions
*/
ast_channel_unlock(chan);
- res = chan->generator->generate(chan, tmp, f->datalen, samples);
+ res = generate(chan, tmp, f->datalen, f->samples);
ast_channel_lock(chan);
chan->generatordata = tmp;
if (res) {