mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 08:09:26 +01:00
Correct stopping of Core in OSX via Command+Q, and fix a thread from not dying when stopping with CoreAudio
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5013 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
5485506293
commit
675e1f668e
1
Externals/WiiUseSrc/Src/io_osx.m
vendored
1
Externals/WiiUseSrc/Src/io_osx.m
vendored
@ -356,6 +356,7 @@ int wiiuse_io_read(struct wiimote_t* wm) {
|
|||||||
CFRunLoopRun();
|
CFRunLoopRun();
|
||||||
|
|
||||||
memcpy(wm->event_buf,DataFromWiimote,sizeof(wm->event_buf));
|
memcpy(wm->event_buf,DataFromWiimote,sizeof(wm->event_buf));
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -116,15 +116,28 @@ bool CoreAudioSound::CoreAudioInit()
|
|||||||
|
|
||||||
err = AudioOutputUnitStart(soundStruct->audioUnit);
|
err = AudioOutputUnitStart(soundStruct->audioUnit);
|
||||||
if (err)
|
if (err)
|
||||||
printf("error when stating audiounit\n");
|
printf("error when starting audiounit\n");
|
||||||
|
|
||||||
while(!threadData)
|
do
|
||||||
{
|
{
|
||||||
soundCriticalSection.Enter();
|
soundCriticalSection.Enter();
|
||||||
m_mixer->Mix(soundStruct->realtimeBuffer, numBytesToRender);
|
m_mixer->Mix(soundStruct->realtimeBuffer, numBytesToRender);
|
||||||
soundCriticalSection.Leave();
|
soundCriticalSection.Leave();
|
||||||
soundSyncEvent.Wait();
|
soundSyncEvent.Wait();
|
||||||
}
|
}while(!threadData);
|
||||||
|
|
||||||
|
err = AudioOutputUnitStop(soundStruct->audioUnit);
|
||||||
|
if(err)
|
||||||
|
printf("error when sopping audiounit\n");
|
||||||
|
|
||||||
|
err = AudioUnitUninitialize(soundStruct->audioUnit);
|
||||||
|
if(err)
|
||||||
|
printf("Error uninitializing audiounit\n");
|
||||||
|
|
||||||
|
err = CloseComponent(soundStruct->audioUnit);
|
||||||
|
if(err)
|
||||||
|
printf("Error while closing component\n");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -148,6 +161,8 @@ bool CoreAudioSound::Start()
|
|||||||
|
|
||||||
void CoreAudioSound::Stop()
|
void CoreAudioSound::Stop()
|
||||||
{
|
{
|
||||||
|
threadData = 1;
|
||||||
|
soundSyncEvent.Set();
|
||||||
delete thread;
|
delete thread;
|
||||||
thread = NULL;
|
thread = NULL;
|
||||||
|
|
||||||
|
@ -188,7 +188,7 @@ int main(int argc, char *argv[])
|
|||||||
event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES ];
|
event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES ];
|
||||||
if(cocoaSendEvent(event))
|
if(cocoaSendEvent(event))
|
||||||
{
|
{
|
||||||
PowerPC::Shutdown();
|
Core::Stop();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -567,6 +567,7 @@ void OpenGL_Update()
|
|||||||
// Close plugin
|
// Close plugin
|
||||||
void OpenGL_Shutdown()
|
void OpenGL_Shutdown()
|
||||||
{
|
{
|
||||||
|
printf("Deleting\n");
|
||||||
#if defined(USE_WX) && USE_WX
|
#if defined(USE_WX) && USE_WX
|
||||||
delete GLWin.glCanvas;
|
delete GLWin.glCanvas;
|
||||||
delete GLWin.frame;
|
delete GLWin.frame;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user