From 1fdf99cf1a38ec6f3f2db69f2e4f946af17d7167 Mon Sep 17 00:00:00 2001 From: rogerman Date: Mon, 13 Feb 2012 22:27:28 +0000 Subject: [PATCH] Cocoa Port: - Fix potential deadlock upon application exit when running on Mac OS X v10.7. --- desmume/src/cocoa/sndOSX.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/desmume/src/cocoa/sndOSX.cpp b/desmume/src/cocoa/sndOSX.cpp index 0245483a0..15e26d2a8 100644 --- a/desmume/src/cocoa/sndOSX.cpp +++ b/desmume/src/cocoa/sndOSX.cpp @@ -1,6 +1,6 @@ /* Copyright (C) 2007 Jeff Bland - Copyright (C) 2007-2011 DeSmuME team + Copyright (C) 2007-2012 DeSmuME team This file is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -54,14 +54,11 @@ OSStatus soundMixer(void *inRefCon, AudioBufferList *ioData) { //printf("SOUND CALLBACK %u off%u pos%u\n", inNumberFrames * 4, sound_offset, sound_position); + UInt8 *__restrict__ outputData = (UInt8 *)ioData->mBuffers[0].mData; const size_t copySize = inNumberFrames * SPU_STEREO_SAMPLE_SIZE; size_t hiBufferAvailable = 0; size_t loBufferAvailable = 0; - pthread_mutex_lock(mutexAudioUnit); - - UInt8 *__restrict__ outputData = (UInt8 *)ioData->mBuffers[0].mData; - pthread_mutex_lock(mutexSoundData); if(sound_data != NULL) @@ -137,8 +134,6 @@ OSStatus soundMixer(void *inRefCon, //ExtAudioFileWrite(outfile, inNumberFrames, ioData); } - pthread_mutex_unlock(mutexAudioUnit); - return noErr; }