Commit b9bcfeaf authored by Warren Dukes's avatar Warren Dukes

closing the audio device seems to work now

git-svn-id: https://svn.musicpd.org/mpd/trunk@3089 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent 9f00e2a8
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment