pj_timer_heap_set_lock(ioqueue->timerheap, lock, PJ_TRUE);
- if (pj_ioqueue_create(ioqueue->pool, 16, &ioqueue->ioqueue) != PJ_SUCCESS) {
+ if (pj_ioqueue_create(ioqueue->pool, PJ_IOQUEUE_MAX_HANDLES, &ioqueue->ioqueue) != PJ_SUCCESS) {
goto fatal;
}
/*! \brief Worker thread for timerheap */
static int timer_worker_thread(void *data)
{
+ pj_ioqueue_t *ioqueue;
+
+ if (pj_ioqueue_create(pool, 1, &ioqueue) != PJ_SUCCESS) {
+ return -1;
+ }
+
while (!timer_terminate) {
+ const pj_time_val delay = {0, 10};
+
pj_timer_heap_poll(timer_heap, NULL);
+ pj_ioqueue_poll(ioqueue, &delay);
}
return 0;
static int ast_rtp_destroy(struct ast_rtp_instance *instance)
{
struct ast_rtp *rtp = ast_rtp_instance_get_data(instance);
+#ifdef HAVE_PJPROJECT
struct timeval wait = ast_tvadd(ast_tvnow(), ast_samp2tv(TURN_STATE_WAIT_TIME, 1000));
struct timespec ts = { .tv_sec = wait.tv_sec, .tv_nsec = wait.tv_usec * 1000, };
+#endif
/* Destroy the smoother that was smoothing out audio if present */
if (rtp->smoother) {