aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2005-03-16 23:05:25 +0000
committerWarren Dukes <warren.dukes@gmail.com>2005-03-16 23:05:25 +0000
commit9f00e2a8f7568122ac0883062bb28e37a4a9e176 (patch)
treef39f5666bace09a9c9c8fd31c21a18cf86b1bd32 /src
parentd6607f5f23f9215ce055697eb0fc551131dc321b (diff)
downloadmpd-9f00e2a8f7568122ac0883062bb28e37a4a9e176.tar.gz
mpd-9f00e2a8f7568122ac0883062bb28e37a4a9e176.tar.xz
mpd-9f00e2a8f7568122ac0883062bb28e37a4a9e176.zip
attempt to close the osx device
git-svn-id: https://svn.musicpd.org/mpd/trunk@3088 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/audioOutputs/audioOutput_osx.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/audioOutputs/audioOutput_osx.c b/src/audioOutputs/audioOutput_osx.c
index c14bdc17d..47f3621dc 100644
--- a/src/audioOutputs/audioOutput_osx.c
+++ b/src/audioOutputs/audioOutput_osx.c
@@ -102,7 +102,19 @@ static void osx_dropBufferedAudio(AudioOutput * audioOutput) {
}
static void osx_closeDevice(AudioOutput * audioOutput) {
- //OsxData * od = (OsxData *) audioOutput->data;
+ OsxData * od = (OsxData *) audioOutput->data;
+
+ pthread_mutex_lock(&od->mutex);
+ while(od->len) {
+ pthread_cond_wait(&od->condition, &od->mutex);
+ }
+ od->go = 0;
+ pthread_mutex_unlock(&od->mutex);
+
+ AudioOutputUnitStop(od->au);
+
+ CloseComponent(od->au);
+ AudioUnitUninitialize(od->au);
audioOutput->open = 0;
}