Skip to content

Commit

Permalink
do not compute packet delay for PLC
Browse files Browse the repository at this point in the history
  • Loading branch information
jchavanton committed Nov 16, 2023
1 parent 1a7c106 commit 6b11548
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/switch_core_media.c
Original file line number Diff line number Diff line change
Expand Up @@ -16463,6 +16463,14 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
}

error:
if (frame->received_ts > 0) {
int64_t d = (switch_micro_time_now() - frame->received_ts)/1000;
if (d > 5000) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "[%ld]-[%ld]=[%ld]\n", (int64_t)(switch_micro_time_now()/1000), (int64_t)(frame->received_ts/1000), d);
}
packet_stats_update(&session->stats, d);
}

packet_stats_update(&session->stats, (switch_micro_time_now() - frame->received_ts)/1000);
session->stats.io_info.out_codec = write_frame->codec->implementation->iananame;
session->stats.io_info.in_codec = frame->codec->implementation->iananame;
Expand Down
1 change: 1 addition & 0 deletions src/switch_ivr_bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,7 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj)
}

if (switch_test_flag((read_frame), SFF_PLC)) {
read_frame->received_ts = 0;
switch_core_session_increment_plc(session_b);
} else {
if (read_frame->packetlen > 0)
Expand Down

0 comments on commit 6b11548

Please sign in to comment.