Make a constant for the park signal in case we want to change it
This commit is contained in:
parent
e3ce9ae828
commit
8d840d89ea
1 changed files with 3 additions and 2 deletions
|
@ -17,6 +17,7 @@
|
||||||
#include <sys/audioio.h>
|
#include <sys/audioio.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|
||||||
|
static const int parkSignal = SIGUSR1;
|
||||||
static pthread_t mainThread;
|
static pthread_t mainThread;
|
||||||
static int sndfp;
|
static int sndfp;
|
||||||
static void (*parent_callback)(long *stream, size_t frames_total);
|
static void (*parent_callback)(long *stream, size_t frames_total);
|
||||||
|
@ -46,7 +47,7 @@ static void* soundcheckthread(void*) {
|
||||||
// park the main thread since the game probably expects it to not be
|
// park the main thread since the game probably expects it to not be
|
||||||
// doing anything else while we're requesting audio frames.
|
// doing anything else while we're requesting audio frames.
|
||||||
audioDone = false;
|
audioDone = false;
|
||||||
pthread_kill(mainThread, SIGUSR1);
|
pthread_kill(mainThread, parkSignal);
|
||||||
|
|
||||||
parent_callback(mix, 0x400 * 2);
|
parent_callback(mix, 0x400 * 2);
|
||||||
|
|
||||||
|
@ -80,7 +81,7 @@ unsigned long SoftwareMixerBackend_Init(void (*callback)(long *stream, size_t fr
|
||||||
audioInfo.port = AUDIO_SPEAKER;
|
audioInfo.port = AUDIO_SPEAKER;
|
||||||
ioctl(sndfp, AUDIO_SETINFO, &audioInfo);
|
ioctl(sndfp, AUDIO_SETINFO, &audioInfo);
|
||||||
|
|
||||||
if(signal(SIGUSR1, threadPark) == SIG_ERR) {
|
if(signal(parkSignal, threadPark) == SIG_ERR) {
|
||||||
Backend_PrintError("Failed to register thread park signal handler for audio system.\n");
|
Backend_PrintError("Failed to register thread park signal handler for audio system.\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue