fix cng frame issue
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9894 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
d45c37c2d2
commit
d1a23b7001
|
@ -468,6 +468,8 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*frame = NULL;
|
||||||
|
|
||||||
while(switch_test_flag(tech_pvt, TFLAG_LINKED) && tech_pvt->other_tech_pvt && !switch_test_flag(tech_pvt->other_tech_pvt, TFLAG_WRITE)) {
|
while(switch_test_flag(tech_pvt, TFLAG_LINKED) && tech_pvt->other_tech_pvt && !switch_test_flag(tech_pvt->other_tech_pvt, TFLAG_WRITE)) {
|
||||||
if (!switch_channel_ready(channel)) {
|
if (!switch_channel_ready(channel)) {
|
||||||
goto end;
|
goto end;
|
||||||
|
@ -478,17 +480,23 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
|
||||||
switch_yield(1000);
|
switch_yield(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (switch_test_flag(tech_pvt, TFLAG_CNG)) {
|
if (switch_test_flag(tech_pvt, TFLAG_LINKED)) {
|
||||||
*frame = &tech_pvt->cng_frame;
|
if (switch_test_flag(tech_pvt, TFLAG_CNG)) {
|
||||||
switch_clear_flag_locked(tech_pvt, TFLAG_CNG);
|
*frame = &tech_pvt->cng_frame;
|
||||||
} else if (tech_pvt->other_tech_pvt && switch_test_flag(tech_pvt->other_tech_pvt, TFLAG_WRITE)) {
|
tech_pvt->cng_frame.codec = &tech_pvt->read_codec;
|
||||||
*frame = &tech_pvt->other_tech_pvt->write_frame;
|
switch_set_flag((&tech_pvt->cng_frame), SFF_CNG);
|
||||||
switch_clear_flag_locked(tech_pvt->other_tech_pvt, TFLAG_WRITE);
|
switch_clear_flag_locked(tech_pvt, TFLAG_CNG);
|
||||||
|
} else if (tech_pvt->other_tech_pvt && switch_test_flag(tech_pvt->other_tech_pvt, TFLAG_WRITE)) {
|
||||||
|
*frame = &tech_pvt->other_tech_pvt->write_frame;
|
||||||
|
switch_clear_flag_locked(tech_pvt->other_tech_pvt, TFLAG_WRITE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//printf("READ %s %d\n", switch_channel_get_name(channel), (*frame)->datalen);
|
if (*frame) {
|
||||||
status = SWITCH_STATUS_SUCCESS;
|
status = SWITCH_STATUS_SUCCESS;
|
||||||
|
} else {
|
||||||
|
status = SWITCH_STATUS_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue