Ticket #516: ticket516.patch
File ticket516.patch, 1.8 KB (added by nanang, 17 years ago) |
---|
-
pjmedia/src/pjmedia/pasound.c
69 69 pj_bool_t quit_flag; 70 70 71 71 pj_bool_t rec_thread_exited; 72 pj_bool_t rec_thread_initialized;72 //pj_bool_t rec_thread_initialized; 73 73 pj_thread_desc rec_thread_desc; 74 74 pj_thread_t *rec_thread; 75 75 76 76 pj_bool_t play_thread_exited; 77 pj_bool_t play_thread_initialized;77 //pj_bool_t play_thread_initialized; 78 78 pj_thread_desc play_thread_desc; 79 79 pj_thread_t *play_thread; 80 80 }; … … 101 101 if (input == NULL) 102 102 return paContinue; 103 103 104 if (stream->rec_thread_initialized == 0) { 104 // Sometime the thread, where this callback called from, is changed 105 // (e.g: in MacOS this happens when plugging/unplugging headphone) 106 // if (stream->rec_thread_initialized == 0) { 107 if (!pj_thread_is_registered()) { 105 108 status = pj_thread_register("pa_rec", stream->rec_thread_desc, 106 109 &stream->rec_thread); 107 stream->rec_thread_initialized = 1;110 //stream->rec_thread_initialized = 1; 108 111 PJ_LOG(5,(THIS_FILE, "Recorder thread started")); 109 112 } 110 113 … … 151 154 if (output == NULL) 152 155 return paContinue; 153 156 154 if (stream->play_thread_initialized == 0) { 157 // Sometime the thread, where this callback called from, is changed 158 // (e.g: in MacOS this happens when plugging/unplugging headphone) 159 // if (stream->play_thread_initialized == 0) { 160 if (!pj_thread_is_registered()) { 155 161 status = pj_thread_register("portaudio", stream->play_thread_desc, 156 162 &stream->play_thread); 157 stream->play_thread_initialized = 1;163 //stream->play_thread_initialized = 1; 158 164 PJ_LOG(5,(THIS_FILE, "Player thread started")); 159 165 } 160 166