dect
/
asterisk
Archived
13
0
Fork 0

It is possible for framein to get called and no channel be available, so do a check before we increment the count.

git-svn-id: http://svn.digium.com/svn/asterisk/trunk@49716 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
file 2007-01-05 23:51:43 +00:00
parent 914e1056d5
commit 60c952cca8
1 changed files with 8 additions and 0 deletions

View File

@ -142,10 +142,18 @@ static int zap_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
if(!ztp->inuse) {
ast_mutex_lock(&channelcount);
if(pvt->t->dstfmt == 8 || pvt->t->dstfmt == 0 ) {
if (complexinuse == totalchannels) {
ast_mutex_unlock(&channelcount);
return -1;
}
complexinuse++;
if(complexinuse == totalchannels)
deactivate_translator(0);
} else {
if (simpleinuse == totalchannels) {
ast_mutex_unlock(&channelcount);
return -1;
}
simpleinuse++;
if(simpleinuse == totalchannels)
deactivate_translator(1);