mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
50 lines
1.1 KiB
Diff
50 lines
1.1 KiB
Diff
|
diff --git a/media/libsydneyaudio/src/sydney_audio_oss.c b/media/libsydneyaudio/src/sydney_audio_oss.c
|
||
|
--- a/media/libsydneyaudio/src/sydney_audio_oss.c
|
||
|
+++ b/media/libsydneyaudio/src/sydney_audio_oss.c
|
||
|
@@ -253,39 +253,44 @@ sa_stream_open(sa_stream_t *s) {
|
||
|
|
||
|
return SA_SUCCESS;
|
||
|
}
|
||
|
|
||
|
|
||
|
int
|
||
|
sa_stream_destroy(sa_stream_t *s) {
|
||
|
int result = SA_SUCCESS;
|
||
|
+ pthread_t thread_id;
|
||
|
|
||
|
if (s == NULL) {
|
||
|
return SA_SUCCESS;
|
||
|
}
|
||
|
|
||
|
pthread_mutex_lock(&s->mutex);
|
||
|
|
||
|
+ thread_id = s->thread_id;
|
||
|
+
|
||
|
/*
|
||
|
- * This causes the thread sending data to ALSA to stop
|
||
|
+ * This causes the thread sending data to OSS to stop
|
||
|
*/
|
||
|
s->thread_id = 0;
|
||
|
|
||
|
/*
|
||
|
* Shut down the audio output device.
|
||
|
*/
|
||
|
if (s->output_fd != -1) {
|
||
|
if (s->playing && close(s->output_fd) < 0) {
|
||
|
result = SA_ERROR_SYSTEM;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
pthread_mutex_unlock(&s->mutex);
|
||
|
|
||
|
+ pthread_join(thread_id, NULL);
|
||
|
+
|
||
|
/*
|
||
|
* Release resources.
|
||
|
*/
|
||
|
if (pthread_mutex_destroy(&s->mutex) != 0) {
|
||
|
result = SA_ERROR_SYSTEM;
|
||
|
}
|
||
|
while (s->bl_head != NULL) {
|
||
|
sa_buf * next = s->bl_head->next;
|