|
Lines 258-263
Link Here
|
| 258 |
int |
258 |
int |
| 259 |
sa_stream_destroy(sa_stream_t *s) { |
259 |
sa_stream_destroy(sa_stream_t *s) { |
| 260 |
int result = SA_SUCCESS; |
260 |
int result = SA_SUCCESS; |
|
|
261 |
pthread_t thread_id; |
| 261 |
|
262 |
|
| 262 |
if (s == NULL) { |
263 |
if (s == NULL) { |
| 263 |
return SA_SUCCESS; |
264 |
return SA_SUCCESS; |
|
Lines 265-272
Link Here
|
| 265 |
|
266 |
|
| 266 |
pthread_mutex_lock(&s->mutex); |
267 |
pthread_mutex_lock(&s->mutex); |
| 267 |
|
268 |
|
|
|
269 |
thread_id = s->thread_id; |
| 270 |
|
| 268 |
/* |
271 |
/* |
| 269 |
* This causes the thread sending data to ALSA to stop |
272 |
* This causes the thread sending data to OSS to stop |
| 270 |
*/ |
273 |
*/ |
| 271 |
s->thread_id = 0; |
274 |
s->thread_id = 0; |
| 272 |
|
275 |
|
|
Lines 281-286
Link Here
|
| 281 |
|
284 |
|
| 282 |
pthread_mutex_unlock(&s->mutex); |
285 |
pthread_mutex_unlock(&s->mutex); |
| 283 |
|
286 |
|
|
|
287 |
pthread_join(thread_id, NULL); |
| 288 |
|
| 284 |
/* |
289 |
/* |
| 285 |
* Release resources. |
290 |
* Release resources. |
| 286 |
*/ |
291 |
*/ |