diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2005-03-16 23:05:25 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2005-03-16 23:05:25 +0000 |
commit | 9f00e2a8f7568122ac0883062bb28e37a4a9e176 (patch) | |
tree | f39f5666bace09a9c9c8fd31c21a18cf86b1bd32 /src/audioOutputs/audioOutput_osx.c | |
parent | d6607f5f23f9215ce055697eb0fc551131dc321b (diff) | |
download | mpd-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 'src/audioOutputs/audioOutput_osx.c')
-rw-r--r-- | src/audioOutputs/audioOutput_osx.c | 14 |
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; } |