File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change 20
20
static unsigned char queued_audio [8192 ];
21
21
static size_t queued_audio_start = 0 ;
22
22
static size_t queued_audio_end = 0 ;
23
- static pthread_mutex_t queued_audio_mutex ;
24
- static pthread_cond_t queued_audio_cond ;
23
+ static pthread_mutex_t queued_audio_mutex = PTHREAD_MUTEX_INITIALIZER ;
24
+ static pthread_cond_t queued_audio_cond = PTHREAD_COND_INITIALIZER ;
25
25
26
26
int send_audio_packet (const void * data , size_t len )
27
27
{
@@ -173,9 +173,6 @@ void *listen_audio(void *x)
173
173
queued_audio_start = 0 ;
174
174
queued_audio_end = 0 ;
175
175
176
- pthread_mutex_init (& queued_audio_mutex , 0 );
177
- pthread_cond_init (& queued_audio_cond , 0 );
178
-
179
176
pthread_t mic_thread ;
180
177
int mic_thread_created = 1 ;
181
178
if (pthread_create (& mic_thread , 0 , handle_queued_audio , info ) != 0 ) {
@@ -198,9 +195,6 @@ void *listen_audio(void *x)
198
195
pthread_join (mic_thread , 0 );
199
196
}
200
197
201
- pthread_cond_destroy (& queued_audio_cond );
202
- pthread_mutex_destroy (& queued_audio_mutex );
203
-
204
198
pthread_exit (NULL );
205
199
206
200
return NULL ;
You can’t perform that action at this time.
0 commit comments