From b9bcfeaf49e9433f6afc39ffda210ad8df44f175 Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Wed, 16 Mar 2005 23:11:08 +0000 Subject: closing the audio device seems to work now git-svn-id: https://svn.musicpd.org/mpd/trunk@3089 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/audioOutputs/audioOutput_osx.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/audioOutputs') diff --git a/src/audioOutputs/audioOutput_osx.c b/src/audioOutputs/audioOutput_osx.c index 47f3621dc..2274f3361 100644 --- a/src/audioOutputs/audioOutput_osx.c +++ b/src/audioOutputs/audioOutput_osx.c @@ -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; } -- cgit v1.2.3