Changeset 766
- Timestamp:
- Oct 12, 2006 4:00:02 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/pasound.c
r762 r766 64 64 pj_bool_t quit_flag; 65 65 66 pj_bool_t thread_exited; 67 pj_bool_t thread_initialized; 68 pj_thread_desc thread_desc; 69 pj_thread_t *thread; 66 pj_bool_t rec_thread_exited; 67 pj_bool_t rec_thread_initialized; 68 pj_thread_desc rec_thread_desc; 69 pj_thread_t *rec_thread; 70 71 pj_bool_t play_thread_exited; 72 pj_bool_t play_thread_initialized; 73 pj_thread_desc play_thread_desc; 74 pj_thread_t *play_thread; 70 75 }; 71 76 … … 90 95 return paContinue; 91 96 92 if (stream-> thread_initialized == 0) {93 status = pj_thread_register("pa_rec", stream-> thread_desc,94 &stream-> thread);95 stream-> thread_initialized = 1;97 if (stream->rec_thread_initialized == 0) { 98 status = pj_thread_register("pa_rec", stream->rec_thread_desc, 99 &stream->rec_thread); 100 stream->rec_thread_initialized = 1; 96 101 PJ_LOG(5,(THIS_FILE, "Recorder thread started")); 97 102 } … … 113 118 114 119 on_break: 115 stream-> thread_exited = 1;120 stream->rec_thread_exited = 1; 116 121 return paAbort; 117 122 } … … 138 143 return paContinue; 139 144 140 if (stream-> thread_initialized == 0) {141 status = pj_thread_register("portaudio", stream-> thread_desc,142 &stream-> thread);143 stream-> thread_initialized = 1;145 if (stream->play_thread_initialized == 0) { 146 status = pj_thread_register("portaudio", stream->play_thread_desc, 147 &stream->play_thread); 148 stream->play_thread_initialized = 1; 144 149 PJ_LOG(5,(THIS_FILE, "Player thread started")); 145 150 } … … 159 164 160 165 on_break: 161 stream-> thread_exited = 1;166 stream->play_thread_exited = 1; 162 167 return paAbort; 163 168 } … … 744 749 745 750 stream->quit_flag = 1; 746 for (i=0; !stream->thread_exited && i<100; ++i) 751 for (i=0; !stream->rec_thread_exited && i<100; ++i) 752 pj_thread_sleep(10); 753 for (i=0; !stream->play_thread_exited && i<100; ++i) 747 754 pj_thread_sleep(10); 748 755 … … 770 777 771 778 stream->quit_flag = 1; 772 for (i=0; !stream->thread_exited && i<100; ++i) { 779 for (i=0; !stream->rec_thread_exited && i<100; ++i) { 780 pj_thread_sleep(1); 781 } 782 for (i=0; !stream->play_thread_exited && i<100; ++i) { 773 783 pj_thread_sleep(1); 774 784 }
Note: See TracChangeset
for help on using the changeset viewer.