Don't needlessly expose a variable for the backends
This commit is contained in:
parent
2220c22c90
commit
a53e3dda75
10
Alc/ALc.c
10
Alc/ALc.c
@ -360,7 +360,7 @@ static const ALchar alExtList[] =
|
||||
"AL_LOKI_quadriphonic";
|
||||
|
||||
// Mixing Priority Level
|
||||
ALint RTPrioLevel;
|
||||
static ALint RTPrioLevel;
|
||||
|
||||
// Resampler Quality
|
||||
resampler_t DefaultResampler;
|
||||
@ -604,19 +604,19 @@ void al_print(const char *fname, unsigned int line, const char *fmt, ...)
|
||||
fprintf(stderr, "%s", str);
|
||||
}
|
||||
|
||||
void EnableRTPrio(ALint level)
|
||||
void SetRTPriority(void)
|
||||
{
|
||||
ALboolean failed;
|
||||
|
||||
#ifdef _WIN32
|
||||
if(level > 0)
|
||||
if(RTPrioLevel > 0)
|
||||
failed = !SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL);
|
||||
else
|
||||
failed = !SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_NORMAL);
|
||||
#elif defined(HAVE_PTHREAD_SETSCHEDPARAM)
|
||||
struct sched_param param;
|
||||
|
||||
if(level > 0)
|
||||
if(RTPrioLevel > 0)
|
||||
{
|
||||
/* Use the minimum real-time priority possible for now (on Linux this
|
||||
* should be 1 for SCHED_RR) */
|
||||
@ -630,7 +630,7 @@ void EnableRTPrio(ALint level)
|
||||
}
|
||||
#else
|
||||
/* Real-time priority not available */
|
||||
failed = !!level;
|
||||
failed = (RTPrioLevel>0);
|
||||
#endif
|
||||
if(failed)
|
||||
AL_PRINT("Failed to set priority level for thread\n");
|
||||
|
@ -358,7 +358,7 @@ static ALuint ALSAProc(ALvoid *ptr)
|
||||
char *WritePtr;
|
||||
int err;
|
||||
|
||||
EnableRTPrio(RTPrioLevel);
|
||||
SetRTPriority();
|
||||
|
||||
while(!data->killNow)
|
||||
{
|
||||
@ -432,7 +432,7 @@ static ALuint ALSANoMMapProc(ALvoid *ptr)
|
||||
snd_pcm_sframes_t avail;
|
||||
char *WritePtr;
|
||||
|
||||
EnableRTPrio(RTPrioLevel);
|
||||
SetRTPriority();
|
||||
|
||||
while(!data->killNow)
|
||||
{
|
||||
@ -488,7 +488,7 @@ static ALuint ALSANoMMapCaptureProc(ALvoid *ptr)
|
||||
alsa_data *data = (alsa_data*)pDevice->ExtraData;
|
||||
snd_pcm_sframes_t avail;
|
||||
|
||||
EnableRTPrio(RTPrioLevel);
|
||||
SetRTPriority();
|
||||
|
||||
while(!data->killNow)
|
||||
{
|
||||
|
@ -163,7 +163,7 @@ static ALuint DSoundProc(ALvoid *ptr)
|
||||
DWORD avail;
|
||||
HRESULT err;
|
||||
|
||||
EnableRTPrio(RTPrioLevel);
|
||||
SetRTPriority();
|
||||
|
||||
memset(&DSBCaps, 0, sizeof(DSBCaps));
|
||||
DSBCaps.dwSize = sizeof(DSBCaps);
|
||||
|
@ -82,7 +82,7 @@ static ALuint OSSProc(ALvoid *ptr)
|
||||
ALint frameSize;
|
||||
ssize_t wrote;
|
||||
|
||||
EnableRTPrio(RTPrioLevel);
|
||||
SetRTPriority();
|
||||
|
||||
frameSize = aluChannelsFromFormat(pDevice->Format) *
|
||||
aluBytesFromFormat(pDevice->Format);
|
||||
@ -124,7 +124,7 @@ static ALuint OSSCaptureProc(ALvoid *ptr)
|
||||
int frameSize;
|
||||
int amt;
|
||||
|
||||
EnableRTPrio(RTPrioLevel);
|
||||
SetRTPriority();
|
||||
|
||||
frameSize = aluBytesFromFormat(pDevice->Format);
|
||||
frameSize *= aluChannelsFromFormat(pDevice->Format);
|
||||
|
@ -57,7 +57,7 @@ static ALuint SolarisProc(ALvoid *ptr)
|
||||
ALint frameSize;
|
||||
int wrote;
|
||||
|
||||
EnableRTPrio(RTPrioLevel);
|
||||
SetRTPriority();
|
||||
|
||||
frameSize = aluChannelsFromFormat(pDevice->Format) *
|
||||
aluBytesFromFormat(pDevice->Format);
|
||||
|
@ -439,8 +439,6 @@ struct ALCcontext_struct
|
||||
ALCcontext *next;
|
||||
};
|
||||
|
||||
extern ALint RTPrioLevel;
|
||||
|
||||
ALCvoid ReleaseALC(ALCvoid);
|
||||
|
||||
void AppendDeviceList(const ALCchar *name);
|
||||
@ -472,7 +470,7 @@ int GetConfigValueInt(const char *blockName, const char *keyName, int def);
|
||||
float GetConfigValueFloat(const char *blockName, const char *keyName, float def);
|
||||
int GetConfigValueBool(const char *blockName, const char *keyName, int def);
|
||||
|
||||
void EnableRTPrio(ALint level);
|
||||
void SetRTPriority(void);
|
||||
|
||||
void SetDefaultChannelOrder(ALCdevice *device);
|
||||
void SetDefaultWFXChannelOrder(ALCdevice *device);
|
||||
|
Loading…
x
Reference in New Issue
Block a user