Cocoa Port:

- Fix potential deadlock upon application exit when running on Mac OS X v10.7.
This commit is contained in:
rogerman 2012-02-13 22:27:28 +00:00
parent c7fd9f79b0
commit 1fdf99cf1a
1 changed files with 2 additions and 7 deletions

View File

@ -1,6 +1,6 @@
/* /*
Copyright (C) 2007 Jeff Bland 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 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 it under the terms of the GNU General Public License as published by
@ -54,14 +54,11 @@ OSStatus soundMixer(void *inRefCon,
AudioBufferList *ioData) AudioBufferList *ioData)
{ {
//printf("SOUND CALLBACK %u off%u pos%u\n", inNumberFrames * 4, sound_offset, sound_position); //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; const size_t copySize = inNumberFrames * SPU_STEREO_SAMPLE_SIZE;
size_t hiBufferAvailable = 0; size_t hiBufferAvailable = 0;
size_t loBufferAvailable = 0; size_t loBufferAvailable = 0;
pthread_mutex_lock(mutexAudioUnit);
UInt8 *__restrict__ outputData = (UInt8 *)ioData->mBuffers[0].mData;
pthread_mutex_lock(mutexSoundData); pthread_mutex_lock(mutexSoundData);
if(sound_data != NULL) if(sound_data != NULL)
@ -137,8 +134,6 @@ OSStatus soundMixer(void *inRefCon,
//ExtAudioFileWrite(outfile, inNumberFrames, ioData); //ExtAudioFileWrite(outfile, inNumberFrames, ioData);
} }
pthread_mutex_unlock(mutexAudioUnit);
return noErr; return noErr;
} }