[asterisk-commits] mmichelson: branch 1.6.0 r114108 - in /branches/1.6.0: ./ main/channel.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Apr 14 10:02:44 CDT 2008
Author: mmichelson
Date: Mon Apr 14 10:02:43 2008
New Revision: 114108
URL: http://svn.digium.com/view/asterisk?view=rev&rev=114108
Log:
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.
........
................
Modified:
branches/1.6.0/ (props changed)
branches/1.6.0/main/channel.c
Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.
Modified: branches/1.6.0/main/channel.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/main/channel.c?view=diff&rev=114108&r1=114107&r2=114108
==============================================================================
--- branches/1.6.0/main/channel.c (original)
+++ branches/1.6.0/main/channel.c Mon Apr 14 10:02:43 2008
@@ -2255,6 +2255,7 @@
{
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;
@@ -2272,6 +2273,10 @@
samples = (int) ( ((float) f->samples) * factor );
} 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
@@ -2282,7 +2287,7 @@
* 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) {
More information about the asterisk-commits
mailing list