switch_rtp_invalid_handler_t invalid_handler;
void *private_data;
uint32_t ts;
+ //uint32_t last_clock_ts;
uint32_t last_write_ts;
uint32_t last_read_ts;
uint32_t last_cng_ts;
if (timestamp) {
rtp_session->ts = (uint32_t) timestamp;
changed++;
- /* Send marker bit if timestamp is lower/same as before (resetted/new timer) */
- if (abs((int32_t)(rtp_session->ts - rtp_session->last_write_ts)) > rtp_session->samples_per_interval
- && !(rtp_session->rtp_bugs & RTP_BUG_NEVER_SEND_MARKER)) {
- m++;
- }
} else if (switch_rtp_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER)) {
- switch_core_timer_sync(&rtp_session->write_timer);
- if (rtp_session->last_write_ts == rtp_session->write_timer.samplecount) {
- switch_core_timer_step(&rtp_session->write_timer);
- }
+ switch_core_timer_next(&rtp_session->write_timer);
rtp_session->ts = rtp_session->write_timer.samplecount;
changed++;
}
if (!changed) {
rtp_session->ts = rtp_session->last_write_ts + rtp_session->samples_per_interval;
+ } else {
+ /* Send marker bit if timestamp is lower/same as before (resetted/new timer) */
+ if (abs((int32_t)(rtp_session->ts - rtp_session->last_write_ts)) > rtp_session->samples_per_interval
+ && !(rtp_session->rtp_bugs & RTP_BUG_NEVER_SEND_MARKER)) {
+ m++;
+ }
}
return m;
int rate = 0, nack_ttl = 0;
uint32_t cur_nack[MAX_NACK] = { 0 };
- if (rtp_session->flags[SWITCH_RTP_FLAG_USE_TIMER]) {
- switch_core_timer_sync(&rtp_session->write_timer);
- }
-
if (!rtp_session->flags[SWITCH_RTP_FLAG_UDPTL] &&
rtp_session->flags[SWITCH_RTP_FLAG_AUTO_CNG] &&
rtp_session->send_msg.header.ts &&
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_DEBUG,
"RE-Starting timer [%s] %d bytes per %dms\n", rtp_session->timer_name, samples_per_interval, ms_per_packet / 1000);
- switch_core_timer_init(&rtp_session->write_timer, rtp_session->timer_name, ms_per_packet / 1000, samples_per_interval, rtp_session->pool);
+ switch_core_timer_init(&rtp_session->write_timer, rtp_session->timer_name, (ms_per_packet / 1000), samples_per_interval, rtp_session->pool);
} else {
memset(&rtp_session->timer, 0, sizeof(rtp_session->timer));
if (switch_core_timer_init(&rtp_session->timer, timer_name, ms_per_packet / 1000, samples_per_interval, pool) == SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_DEBUG,
"Starting timer [%s] %d bytes per %dms\n", timer_name, samples_per_interval, ms_per_packet / 1000);
- switch_core_timer_init(&rtp_session->write_timer, timer_name, ms_per_packet / 1000, samples_per_interval, pool);
+ switch_core_timer_init(&rtp_session->write_timer, timer_name, (ms_per_packet / 1000), samples_per_interval, pool);
#ifdef DEBUG_TS_ROLLOVER
rtp_session->timer.tick = TS_ROLLOVER_START / samples_per_interval;
#endif
if (!rtp_session->last_write_ts) {
if (rtp_session->timer.timer_interface) {
- switch_core_timer_sync(&rtp_session->write_timer);
+ //switch_core_timer_sync(&rtp_session->write_timer);
rtp_session->last_write_ts = rtp_session->write_timer.samplecount;
} else {
rtp_session->last_write_ts = rtp_session->samples_per_interval;
rtp_session->need_mark = 1;
if (rtp_session->flags[SWITCH_RTP_FLAG_USE_TIMER]) {
- switch_core_timer_sync(&rtp_session->write_timer);
+ //switch_core_timer_sync(&rtp_session->write_timer);
rtp_session->last_write_samplecount = rtp_session->write_timer.samplecount;
}
void *pop;
if (rtp_session->flags[SWITCH_RTP_FLAG_USE_TIMER]) {
- switch_core_timer_sync(&rtp_session->write_timer);
+ //switch_core_timer_sync(&rtp_session->write_timer);
if (rtp_session->write_timer.samplecount < rtp_session->next_write_samplecount) {
return;
}
WRITE_INC(rtp_session);
if (rtp_session->flags[SWITCH_RTP_FLAG_USE_TIMER]) {
- switch_core_timer_sync(&rtp_session->write_timer);
+ //switch_core_timer_sync(&rtp_session->write_timer);
}
if (send_msg) {
}
if (rtp_session->flags[SWITCH_RTP_FLAG_USE_TIMER]) {
- switch_core_timer_sync(&rtp_session->write_timer);
+ //switch_core_timer_sync(&rtp_session->write_timer);
}
if (rtp_session->flags[SWITCH_RTP_FLAG_USE_TIMER] &&
}
if (rtp_session->flags[SWITCH_RTP_FLAG_USE_TIMER]) {
- switch_core_timer_sync(&rtp_session->write_timer);
+ //switch_core_timer_sync(&rtp_session->write_timer);
rtp_session->last_write_samplecount = rtp_session->write_timer.samplecount;
}