move the calls to ast_jb_configure() to before the PBX thread is started on the

channel to remove the theoretical race condition that the channel could get
bridged before the channel's jitterbuffer gets configured.  This was pointed
out by PCadach on IRC.  Thanks!


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@39964 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2006-08-16 03:43:47 +00:00
parent b6a99250ed
commit 9f9a5f1984
7 changed files with 13 additions and 24 deletions

View File

@@ -829,6 +829,7 @@ static struct ast_channel *alsa_new(struct chan_alsa_pvt *p, int state)
usecnt++;
ast_mutex_unlock(&usecnt_lock);
ast_update_use_count();
ast_jb_configure(tmp, &global_jbconf);
if (state != AST_STATE_DOWN) {
if (ast_pbx_start(tmp)) {
ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
@@ -836,8 +837,6 @@ static struct ast_channel *alsa_new(struct chan_alsa_pvt *p, int state)
tmp = NULL;
}
}
if (tmp)
ast_jb_configure(tmp, &global_jbconf);
}
return tmp;
}