diff options
author | Russell Bryant <russell@russellbryant.com> | 2006-06-23 16:49:12 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2006-06-23 16:49:12 +0000 |
commit | c8ceb92a4fe74ff05fc26b9da80ab2c17af5a931 (patch) | |
tree | 9df57ec67d82e432a214c23cd83cc42f9889c78f /channels/chan_oss.c | |
parent | b8518110da185cd5655983811705ca6b420a883b (diff) |
revert my changes that converted the jb on the channel to be dynamically
allocated. These changes caused crashes when using a channel type that did
not support the jitterbuffer. Instead of fixing why it's crashing, I'm going
to implement this in a better way next week. The way I did it caused a
jitterbuffer to be allocated on every channel where the channel type supported
jitterbuffers, even if they were disabled.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@35746 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_oss.c')
-rw-r--r-- | channels/chan_oss.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/channels/chan_oss.c b/channels/chan_oss.c index 36a418bd0..98ca519de 100644 --- a/channels/chan_oss.c +++ b/channels/chan_oss.c @@ -1000,24 +1000,21 @@ static struct ast_channel *oss_new(struct chan_oss_pvt *o, o->owner = c; ast_setstate(c, state); - if (ast_jb_configure(c, &global_jbconf)) { - ast_hangup(c); - o->owner = NULL; - return NULL; - } + ast_mutex_lock(&usecnt_lock); + usecnt++; + ast_mutex_unlock(&usecnt_lock); + ast_update_use_count(); if (state != AST_STATE_DOWN) { if (ast_pbx_start(c)) { ast_log(LOG_WARNING, "Unable to start PBX on %s\n", c->name); ast_hangup(c); - o->owner = NULL; - return NULL; + o->owner = c = NULL; + /* XXX what about the channel itself ? */ + /* XXX what about usecnt ? */ } } - - ast_mutex_lock(&usecnt_lock); - usecnt++; - ast_mutex_unlock(&usecnt_lock); - ast_update_use_count(); + if (c) + ast_jb_configure(c, &global_jbconf); return c; } |