closing the audio device seems to work now

git-svn-id: https://svn.musicpd.org/mpd/trunk@3089 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
Warren Dukes 2005-03-16 23:11:08 +00:00
parent 9f00e2a8f7
commit b9bcfeaf49

View File

@ -104,18 +104,26 @@ static void osx_dropBufferedAudio(AudioOutput * audioOutput) {
static void osx_closeDevice(AudioOutput * audioOutput) {
OsxData * od = (OsxData *) audioOutput->data;
DEBUG("entering osx_closeDevice\n");
pthread_mutex_lock(&od->mutex);
od->go = 0;
while(od->len) {
DEBUG("osx_closeDevice: cond_wait\n");
pthread_cond_wait(&od->condition, &od->mutex);
}
od->go = 0;
pthread_mutex_unlock(&od->mutex);
DEBUG("stopping au\n");
AudioOutputUnitStop(od->au);
DEBUG("closing au\n");
CloseComponent(od->au);
AudioUnitUninitialize(od->au);
DEBUG("Leaving osx_closeDevice\n");
audioOutput->open = 0;
}