Merged revisions 56055 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r56055 | russell | 2007-02-21 19:24:10 -0600 (Wed, 21 Feb 2007) | 3 lines

Restructure a little bit of code to reduce nesting.  There is no functionality
change here.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@56056 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.6.0
Russell Bryant 19 years ago
parent 80fce39036
commit a6cbe5d651

@ -4420,9 +4420,10 @@ static struct ast_frame *sip_rtp_read(struct ast_channel *ast, struct sip_pvt *p
(ast_test_flag(&p->flags[0], SIP_DTMF) != SIP_DTMF_RFC2833)) (ast_test_flag(&p->flags[0], SIP_DTMF) != SIP_DTMF_RFC2833))
return &ast_null_frame; return &ast_null_frame;
if (p->owner) {
/* We already hold the channel lock */ /* We already hold the channel lock */
if (f->frametype == AST_FRAME_VOICE) { if (!p->owner || f->frametype != AST_FRAME_VOICE)
return f;
if (f->subclass != (p->owner->nativeformats & AST_FORMAT_AUDIO_MASK)) { if (f->subclass != (p->owner->nativeformats & AST_FORMAT_AUDIO_MASK)) {
if (!(f->subclass & p->jointcapability)) { if (!(f->subclass & p->jointcapability)) {
if (option_debug) { if (option_debug) {
@ -4437,6 +4438,7 @@ static struct ast_frame *sip_rtp_read(struct ast_channel *ast, struct sip_pvt *p
ast_set_read_format(p->owner, p->owner->readformat); ast_set_read_format(p->owner, p->owner->readformat);
ast_set_write_format(p->owner, p->owner->writeformat); ast_set_write_format(p->owner, p->owner->writeformat);
} }
if ((ast_test_flag(&p->flags[0], SIP_DTMF) == SIP_DTMF_INBAND) && p->vad) { if ((ast_test_flag(&p->flags[0], SIP_DTMF) == SIP_DTMF_INBAND) && p->vad) {
f = ast_dsp_process(p->owner, p->vad, f); f = ast_dsp_process(p->owner, p->vad, f);
if (f && f->frametype == AST_FRAME_DTMF) { if (f && f->frametype == AST_FRAME_DTMF) {
@ -4449,8 +4451,7 @@ static struct ast_frame *sip_rtp_read(struct ast_channel *ast, struct sip_pvt *p
} }
} }
} }
}
}
return f; return f;
} }

Loading…
Cancel
Save