[svn-commits] file: trunk r423213 - in /trunk: ./ res/res_rtp_asterisk.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Sep 16 16:06:24 CDT 2014


Author: file
Date: Tue Sep 16 16:06:22 2014
New Revision: 423213

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=423213
Log:
Multiple revisions 423209,423212

........
  r423209 | file | 2014-09-16 17:35:34 -0300 (Tue, 16 Sep 2014) | 8 lines
  
  res_rtp_asterisk: Fix building when pjproject is not used.
  ........
  
  Merged revisions 423207 from http://svn.asterisk.org/svn/asterisk/branches/11
  ........
  
  Merged revisions 423208 from http://svn.asterisk.org/svn/asterisk/branches/12
........
  r423212 | file | 2014-09-16 18:03:59 -0300 (Tue, 16 Sep 2014) | 10 lines
  
  res_rtp_asterisk: Fix 100% CPU usage due to timer heap thread spinning.
  
  Side note: I need a vacation.
  ........
  
  Merged revisions 423210 from http://svn.asterisk.org/svn/asterisk/branches/11
  ........
  
  Merged revisions 423211 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 423209,423212 from http://svn.asterisk.org/svn/asterisk/branches/13

Modified:
    trunk/   (props changed)
    trunk/res/res_rtp_asterisk.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-13-merged' - no diff available.

Modified: trunk/res/res_rtp_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_rtp_asterisk.c?view=diff&rev=423213&r1=423212&r2=423213
==============================================================================
--- trunk/res/res_rtp_asterisk.c (original)
+++ trunk/res/res_rtp_asterisk.c Tue Sep 16 16:06:22 2014
@@ -1031,7 +1031,7 @@
 
 	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;
 	}
 
@@ -1700,8 +1700,17 @@
 /*! \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;
@@ -2476,8 +2485,10 @@
 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) {




More information about the svn-commits mailing list