summaryrefslogtreecommitdiff
path: root/pjmedia/src/pjmedia-audiodev/coreaudio_dev.c
diff options
context:
space:
mode:
authorLiong Sauw Ming <ming@teluu.com>2011-10-24 09:28:13 +0000
committerLiong Sauw Ming <ming@teluu.com>2011-10-24 09:28:13 +0000
commit2068f13bc42cf3a47374aa2765f82724a5782028 (patch)
tree29fbeaa152ab51e59b650c0d7cd83a38111e1ecc /pjmedia/src/pjmedia-audiodev/coreaudio_dev.c
parent1c72a42676e7aa0c2ae0734549050f738f3bdf02 (diff)
Re #1395: Backport of PJSIP 1.x branch into PJSIP 2.0 trunk
* Backport of r3557:r3832 TODO: ticket #1268 (Option for automatic/manual sending of RTCP SDES/BYE for the stream) for video stream. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3841 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia/src/pjmedia-audiodev/coreaudio_dev.c')
-rw-r--r--pjmedia/src/pjmedia-audiodev/coreaudio_dev.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/pjmedia/src/pjmedia-audiodev/coreaudio_dev.c b/pjmedia/src/pjmedia-audiodev/coreaudio_dev.c
index fd77c993..c5a3e621 100644
--- a/pjmedia/src/pjmedia-audiodev/coreaudio_dev.c
+++ b/pjmedia/src/pjmedia-audiodev/coreaudio_dev.c
@@ -1111,7 +1111,17 @@ static void interruptionListener(void *inClientData, UInt32 inInterruption)
{
struct stream_list *it, *itBegin;
pj_status_t status;
-
+ pj_thread_desc thread_desc;
+ pj_thread_t *thread;
+
+ /* Register the thread with PJLIB, this is must for any external threads
+ * which need to use the PJLIB framework.
+ */
+ if (!pj_thread_is_registered()) {
+ pj_bzero(thread_desc, sizeof(pj_thread_desc));
+ status = pj_thread_register("intListener", thread_desc, &thread);
+ }
+
PJ_LOG(3, (THIS_FILE, "Session interrupted! --- %s ---",
inInterruption == kAudioSessionBeginInterruption ?
"Begin Interruption" : "End Interruption"));