mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-14 01:49:05 +00:00
FS-7601 #resolve
This commit is contained in:
@@ -467,7 +467,13 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
|
||||
if (!do_bugs) goto done;
|
||||
}
|
||||
|
||||
if (switch_test_flag(read_frame, SFF_PLC)) {
|
||||
if (!switch_test_flag(read_frame->codec, SWITCH_CODEC_FLAG_HAS_PLC) &&
|
||||
(switch_channel_test_flag(session->channel, CF_JITTERBUFFER_PLC) ||
|
||||
switch_channel_test_flag(session->channel, CF_CNG_PLC)) && !session->plc) {
|
||||
session->plc = plc_init(NULL);
|
||||
}
|
||||
|
||||
if (!switch_test_flag(read_frame->codec, SWITCH_CODEC_FLAG_HAS_PLC) && session->plc && 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) / session->read_impl.number_of_channels;
|
||||
session->raw_read_frame.channels = session->read_impl.number_of_channels;
|
||||
@@ -479,7 +485,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
|
||||
if (!switch_core_codec_ready(codec)) {
|
||||
codec = read_frame->codec;
|
||||
}
|
||||
|
||||
|
||||
switch_thread_rwlock_rdlock(session->bug_rwlock);
|
||||
codec->cur_frame = read_frame;
|
||||
session->read_codec->cur_frame = read_frame;
|
||||
@@ -497,11 +503,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
|
||||
}
|
||||
|
||||
if (status == SWITCH_STATUS_SUCCESS && session->read_impl.number_of_channels == 1) {
|
||||
if ((switch_channel_test_flag(session->channel, CF_JITTERBUFFER_PLC) || switch_channel_test_flag(session->channel, CF_CNG_PLC))
|
||||
&& !session->plc) {
|
||||
session->plc = plc_init(NULL);
|
||||
}
|
||||
|
||||
if (session->plc) {
|
||||
if (switch_test_flag(read_frame, SFF_PLC)) {
|
||||
plc_fillin(session->plc, session->raw_read_frame.data, session->raw_read_frame.datalen / 2);
|
||||
|
Reference in New Issue
Block a user