Wii U - Use a frame callback instead of a thread

This commit is contained in:
Clownacy 2020-04-19 19:05:25 +01:00
parent 07ee648181
commit 288c2dccee

View file

@ -94,12 +94,8 @@ static void Callback(void *output_stream, size_t frames_total)
OSUnlockMutex(&organya_mutex);
}
static int ThreadFunction(int argc, const char *argv[])
static void FrameCallback(void)
{
for (;;)
{
OSTestThreadCancel();
static int last_half = 1;
unsigned int half;
@ -143,9 +139,6 @@ static int ThreadFunction(int argc, const char *argv[])
last_half = half;
}
}
return 0;
}
bool AudioBackend_Init(void)
@ -207,9 +200,7 @@ bool AudioBackend_Init(void)
AXVoiceEnd(voice);
//AXRegisterAppFrameCallback(FrameCallback);
OSRunThread(OSGetDefaultThread(0), ThreadFunction, 0, NULL);
AXRegisterAppFrameCallback(FrameCallback);
return true;
}
@ -219,10 +210,6 @@ bool AudioBackend_Init(void)
void AudioBackend_Deinit(void)
{
OSCancelThread(OSGetDefaultThread(0));
OSJoinThread(OSGetDefaultThread(0), NULL);
AXFreeVoice(voice);
AXQuit();