Fix #1195: assertion during thread registration in coreaudio and portaudio's input/output callbacks on Mac OS X and #1196: using system's default audio input/output device instead of first available device.



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@3404 74dad513-b988-da41-8d7b-12977e46ad98
diff --git a/pjmedia/src/pjmedia-audiodev/pa_dev.c b/pjmedia/src/pjmedia-audiodev/pa_dev.c
index 095f772..1188b8a 100644
--- a/pjmedia/src/pjmedia-audiodev/pa_dev.c
+++ b/pjmedia/src/pjmedia-audiodev/pa_dev.c
@@ -185,6 +185,7 @@
      */
     if (stream->rec_thread_initialized == 0 || !pj_thread_is_registered()) 
     {
+	pj_bzero(stream->rec_thread_desc, sizeof(pj_thread_desc));
 	status = pj_thread_register("pa_rec", stream->rec_thread_desc, 
 				    &stream->rec_thread);
 	stream->rec_thread_initialized = 1;
@@ -297,6 +298,7 @@
      */
     if (stream->play_thread_initialized == 0 || !pj_thread_is_registered()) 
     {
+	pj_bzero(stream->play_thread_desc, sizeof(pj_thread_desc));
 	status = pj_thread_register("portaudio", stream->play_thread_desc,
 				    &stream->play_thread);
 	stream->play_thread_initialized = 1;