small tweak to new plc code

This commit is contained in:
Anthony Minessale 2010-12-13 18:14:39 -06:00
parent 2e51b571b0
commit 0ca7930fa3
1 changed files with 14 additions and 7 deletions

View File

@ -325,13 +325,20 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
switch_thread_rwlock_unlock(session->bug_rwlock);
}
status = switch_core_codec_decode(use_codec,
session->read_codec,
read_frame->data,
read_frame->datalen,
session->read_impl.actual_samples_per_second,
session->raw_read_frame.data, &session->raw_read_frame.datalen, &session->raw_read_frame.rate,
&read_frame->flags);
if (switch_test_flag(read_frame, SFF_PLC)) {
session->raw_read_frame.datalen = read_frame->codec->implementation->decoded_bytes_per_packet;
session->raw_read_frame.samples = session->raw_read_frame.datalen / sizeof(int16_t);
memset(session->raw_read_frame.data, 255, session->raw_read_frame.datalen);
status = SWITCH_STATUS_SUCCESS;
} else {
status = switch_core_codec_decode(use_codec,
session->read_codec,
read_frame->data,
read_frame->datalen,
session->read_impl.actual_samples_per_second,
session->raw_read_frame.data, &session->raw_read_frame.datalen, &session->raw_read_frame.rate,
&read_frame->flags);
}
if (status == SWITCH_STATUS_SUCCESS) {
if (switch_channel_test_flag(session->channel, CF_JITTERBUFFER) && !session->plc) {