Skip to content
Snippets Groups Projects
Commit 130eb560 authored by Joshua Colp's avatar Joshua Colp
Browse files

It is possible for framein to get called and no channel be available, so do a...

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: https://origsvn.digium.com/svn/asterisk/trunk@49716 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 21df48d4
Branches
Tags
No related merge requests found
...@@ -142,10 +142,18 @@ static int zap_framein(struct ast_trans_pvt *pvt, struct ast_frame *f) ...@@ -142,10 +142,18 @@ static int zap_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
if(!ztp->inuse) { if(!ztp->inuse) {
ast_mutex_lock(&channelcount); ast_mutex_lock(&channelcount);
if(pvt->t->dstfmt == 8 || pvt->t->dstfmt == 0 ) { if(pvt->t->dstfmt == 8 || pvt->t->dstfmt == 0 ) {
if (complexinuse == totalchannels) {
ast_mutex_unlock(&channelcount);
return -1;
}
complexinuse++; complexinuse++;
if(complexinuse == totalchannels) if(complexinuse == totalchannels)
deactivate_translator(0); deactivate_translator(0);
} else { } else {
if (simpleinuse == totalchannels) {
ast_mutex_unlock(&channelcount);
return -1;
}
simpleinuse++; simpleinuse++;
if(simpleinuse == totalchannels) if(simpleinuse == totalchannels)
deactivate_translator(1); deactivate_translator(1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment