interval = read_impl.microseconds_per_packet / 1000;
//samples = switch_samples_per_packet(read_impl.samples_per_second, interval);
+ if (delay_ms < interval * 2) {
+ delay_ms = interval * 2;
+ switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Minimum possible delay for this codec (%d) has been chosen\n", delay_ms);
+ }
+
+
qlen = delay_ms / (interval) / 2;
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Setting delay to %dms (%d frames)\n", delay_ms, qlen);
jb = stfu_n_init(qlen, qlen, read_impl.samples_per_packet, read_impl.samples_per_second, 0);